org.aspectj.weaver
Interface AnnotationAJ

All Known Implementing Classes:
AbstractAnnotationAJ, BcelAnnotation, StandardAnnotation

public interface AnnotationAJ

Simple representation of an annotation that the weaver can work with.


Field Summary
static AnnotationAJ[] EMPTY_ARRAY
           
 
Method Summary
 boolean allowedOnAnnotationType()
          return true if this annotation can target an annotation type
 boolean allowedOnField()
           
 boolean allowedOnRegularType()
           
 java.lang.String getStringFormOfValue(java.lang.String name)
          Determine the string representation of the value of a field.
 java.util.Set<java.lang.String> getTargets()
           
 ResolvedType getType()
           
 java.lang.String getTypeName()
           
 java.lang.String getTypeSignature()
           
 java.lang.String getValidTargets()
           
 boolean hasNamedValue(java.lang.String name)
           
 boolean hasNameValuePair(java.lang.String name, java.lang.String value)
           
 boolean isRuntimeVisible()
           
 boolean specifiesTarget()
           
 java.lang.String stringify()
           
 

Field Detail

EMPTY_ARRAY

static final AnnotationAJ[] EMPTY_ARRAY
Method Detail

getTypeSignature

java.lang.String getTypeSignature()
Returns:
the signature for the annotation type, eg. Lcom/foo/MyAnno;

getTypeName

java.lang.String getTypeName()
Returns:
the type name for the annotation, eg. com.foo.MyAnno

getType

ResolvedType getType()
Returns:
the type of the annotation

allowedOnAnnotationType

boolean allowedOnAnnotationType()
return true if this annotation can target an annotation type


allowedOnField

boolean allowedOnField()
Returns:
true if this annotation can be put on a field

allowedOnRegularType

boolean allowedOnRegularType()
Returns:
true if this annotation can target a 'regular' type. A 'regular' type is enum/class/interface - it is *not* annotation.

getTargets

java.util.Set<java.lang.String> getTargets()
Returns:
for the @target annotation, this will return a set of the element-types it can be applied to. For other annotations , it returns the empty set.

hasNamedValue

boolean hasNamedValue(java.lang.String name)
Parameters:
name - the name of the value
Returns:
true if there is a value with that name

hasNameValuePair

boolean hasNameValuePair(java.lang.String name,
                         java.lang.String value)
Parameters:
name - the name of the annotation field
value - the value of the annotation field
Returns:
true if there is a value with the specified name and value

getValidTargets

java.lang.String getValidTargets()
Returns:
String representation of the valid targets for this annotation, eg. "{TYPE,FIELD}"

stringify

java.lang.String stringify()
Returns:
String form of the annotation and any values, eg. @Foo(a=b,c=d)

specifiesTarget

boolean specifiesTarget()
Returns:
true if this annotation is marked with @target

isRuntimeVisible

boolean isRuntimeVisible()
Returns:
true if the annotation is marked for runtime visibility

getStringFormOfValue

java.lang.String getStringFormOfValue(java.lang.String name)
Determine the string representation of the value of a field. For example in @SuppressAjWarnings({"adviceDidNotMatch"}) the return value for getStringFormOfValue("value") would be "[adviceDidNotMatch]".

Parameters:
name - the name of the annotation field being looked up
Returns:
string representation of the value of that field, may be null if no such field set