Class StandardAnnotation
java.lang.Object
org.aspectj.weaver.AbstractAnnotationAJ
org.aspectj.weaver.StandardAnnotation
- All Implemented Interfaces:
AnnotationAJ
This type represents the weavers abstraction of an annotation - it is not tied to any underlying BCI toolkit. The weaver actualy
handles these through AnnotationX wrapper objects - until we start transforming the BCEL annotations into this form (expensive)
or offer a clever visitor mechanism over the BCEL annotation stuff that builds these annotation types directly.
- Author:
- AndyClement
-
Field Summary
Fields inherited from class AbstractAnnotationAJ
typeFields inherited from interface AnnotationAJ
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetStringFormOfValue(String name) Determine the string representation of the value of a field.booleanbooleanhasNameValuePair(String n, String v) booleanbooleantoString()Methods inherited from class AbstractAnnotationAJ
allowedOnAnnotationType, allowedOnField, allowedOnRegularType, ensureAtTargetInitialized, getType, getTypeName, getTypeSignature, getValidTargets, specifiesTargetModifier and TypeMethodDescriptionfinal booleanreturn true if this annotation can target an annotation typefinal booleanfinal booleanfinal voidfinal ResolvedTypegetType()final Stringfinal Stringfinal Stringfinal boolean
-
Constructor Details
-
StandardAnnotation
-
-
Method Details
-
isRuntimeVisible
public boolean isRuntimeVisible()- Specified by:
isRuntimeVisiblein interfaceAnnotationAJ- Specified by:
isRuntimeVisiblein classAbstractAnnotationAJ- Returns:
- true if the annotation is marked for runtime visibility
-
stringify
- Specified by:
stringifyin interfaceAnnotationAJ- Specified by:
stringifyin classAbstractAnnotationAJ- Returns:
- String form of the annotation and any values, eg. @Foo(a=b,c=d)
-
toString
-
hasNamedValue
- Specified by:
hasNamedValuein interfaceAnnotationAJ- Specified by:
hasNamedValuein classAbstractAnnotationAJ- Parameters:
n- the name of the value- Returns:
- true if there is a value with that name
-
hasNameValuePair
- Specified by:
hasNameValuePairin interfaceAnnotationAJ- Specified by:
hasNameValuePairin classAbstractAnnotationAJ- Parameters:
n- the name of the annotation fieldv- the value of the annotation field- Returns:
- true if there is a value with the specified name and value
-
getTargets
- Specified by:
getTargetsin interfaceAnnotationAJ- Specified by:
getTargetsin classAbstractAnnotationAJ- 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.
-
getNameValuePairs
-
hasNameValuePairs
public boolean hasNameValuePairs() -
addNameValuePair
-
getStringFormOfValue
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
-