net.sf.staccatocommons.instrument.context
Interface AnnotationContext

All Known Subinterfaces:
ArgumentAnnotationContext, ClassAnnotationContext, ConstructorAnnotationContext, MethodAnnotationContext
All Known Implementing Classes:
AbstractAnnotationContext, DefaultArgumentAnnotationContext, DefaultClassAnnotationContext, DefaultConstructorAnnotationContext, DefaultMethodAnnotationContext

public interface AnnotationContext

Base interface for an annotated element context

Author:
flbulgarelli

Method Summary
 javassist.CtClass getClass(String className)
          Shortcut for getClassPoll().get(className)
 javassist.ClassPool getClassPool()
          Returns the class pool in use by the instrumenter
 javassist.CtClass getDeclaringClass()
          Answers the class were the annotated element is declared.
 javassist.CtClass getElementType()
          Returns the type of the element annotated: When the annotated element is a class, the type is that class When the annotated element is a constructor, the type is the class that declared such constructor When the annotated element is a method, the type is the return type of the method When the annotated element is an argument, the type is argument type
 String getPackage()
          Answers the package of the annotated element
 boolean isPublic()
          If this annotated contextis public, that is: When the annotated element is a class, method or constructor, whether it is marked with the Java public keyword When the annotated element is an argument, whether the enclosing CtBehavior is public
 void logDebugMessage(String message, Object... arguments)
           
 void logErrorMessage(String message, Object... arguments)
           
 void logInfoMessage(String message, Object... arguments)
           
 void logWarnMessage(String message, Object... arguments)
           
 

Method Detail

logDebugMessage

void logDebugMessage(String message,
                     Object... arguments)
Parameters:
message -
arguments -

logInfoMessage

void logInfoMessage(String message,
                    Object... arguments)
Parameters:
message -
arguments -

logWarnMessage

void logWarnMessage(String message,
                    Object... arguments)
Parameters:
message -
arguments -

logErrorMessage

void logErrorMessage(String message,
                     Object... arguments)
Parameters:
message -
arguments -

getDeclaringClass

@NonNull
javassist.CtClass getDeclaringClass()
                                    throws javassist.NotFoundException
Answers the class were the annotated element is declared. If the annotated element is already a top level or anonymous class, returns it.

Returns:
the declaring class of the annotated element
Throws:
javassist.NotFoundException - if such class is not available

getClassPool

@NonNull
javassist.ClassPool getClassPool()
Returns the class pool in use by the instrumenter

Returns:
a ClassPool

getClass

@NonNull
javassist.CtClass getClass(@NonNull
                                   String className)
                           throws javassist.NotFoundException
Shortcut for getClassPoll().get(className)

Throws:
javassist.NotFoundException

getElementType

@NonNull
javassist.CtClass getElementType()
                                 throws javassist.NotFoundException
Returns the type of the element annotated:

getPackage

String getPackage()
Answers the package of the annotated element

Returns:
the package name

isPublic

boolean isPublic()
If this annotated contextis public, that is:


Copyright © 2010-2012 Staccatocommons. All Rights Reserved.