net.sf.staccatocommons.instrument.context.internal
Class AbstractAnnotationContext

java.lang.Object
  extended by net.sf.staccatocommons.instrument.context.internal.AbstractAnnotationContext
All Implemented Interfaces:
AnnotationContext
Direct Known Subclasses:
DefaultArgumentAnnotationContext, DefaultClassAnnotationContext, DefaultConstructorAnnotationContext, DefaultMethodAnnotationContext

public abstract class AbstractAnnotationContext
extends Object
implements AnnotationContext

Author:
flbulgarelli

Constructor Summary
AbstractAnnotationContext(javassist.ClassPool pool, org.slf4j.Logger logger)
          Creates a new AbstractAnnotationContext
 
Method Summary
 javassist.CtClass getClass(String className)
          Shortcut for getClassPoll().get(className)
 javassist.ClassPool getClassPool()
          Returns the class pool in use by the instrumenter
 org.slf4j.Logger getLogger()
           
 String getPackage()
          Answers the package of the annotated element
 Set<String> getPresentAnnotationsTypes(Object[] annotations)
           
 void logDebugMessage(String message, Object... arguments)
           
 void logErrorMessage(String message, Object... arguments)
           
 void logInfoMessage(String message, Object... arguments)
           
 void logWarnMessage(String message, Object... arguments)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.staccatocommons.instrument.context.AnnotationContext
getDeclaringClass, getElementType, isPublic
 

Constructor Detail

AbstractAnnotationContext

public AbstractAnnotationContext(@NonNull
                                 javassist.ClassPool pool,
                                 @NonNull
                                 org.slf4j.Logger logger)
Creates a new AbstractAnnotationContext

Method Detail

getLogger

public org.slf4j.Logger getLogger()
Returns:
the logger

logDebugMessage

public void logDebugMessage(String message,
                            Object... arguments)
Specified by:
logDebugMessage in interface AnnotationContext

logInfoMessage

public void logInfoMessage(String message,
                           Object... arguments)
Specified by:
logInfoMessage in interface AnnotationContext

logWarnMessage

public void logWarnMessage(String message,
                           Object... arguments)
Specified by:
logWarnMessage in interface AnnotationContext

logErrorMessage

public void logErrorMessage(String message,
                            Object... arguments)
Specified by:
logErrorMessage in interface AnnotationContext

getClassPool

public final javassist.ClassPool getClassPool()
Description copied from interface: AnnotationContext
Returns the class pool in use by the instrumenter

Specified by:
getClassPool in interface AnnotationContext
Returns:
a ClassPool

getClass

public javassist.CtClass getClass(String className)
                           throws javassist.NotFoundException
Description copied from interface: AnnotationContext
Shortcut for getClassPoll().get(className)

Specified by:
getClass in interface AnnotationContext
Throws:
javassist.NotFoundException

getPresentAnnotationsTypes

public Set<String> getPresentAnnotationsTypes(Object[] annotations)
Returns:
the presentAnnotations

getPackage

public String getPackage()
Description copied from interface: AnnotationContext
Answers the package of the annotated element

Specified by:
getPackage in interface AnnotationContext
Returns:
the package name


Copyright © 2010-2012 StaccatoCommons. All Rights Reserved.