Package org.aspectj.weaver
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 org.aspectj.weaver.AbstractAnnotationAJ
type
Fields inherited from interface org.aspectj.weaver.AnnotationAJ
EMPTY_ARRAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getStringFormOfValue
(String name) Determine the string representation of the value of a field.boolean
boolean
hasNameValuePair
(String n, String v) boolean
boolean
toString()
Methods inherited from class org.aspectj.weaver.AbstractAnnotationAJ
allowedOnAnnotationType, allowedOnField, allowedOnRegularType, ensureAtTargetInitialized, getType, getTypeName, getTypeSignature, getValidTargets, specifiesTarget
-
Constructor Details
-
StandardAnnotation
-
-
Method Details
-
isRuntimeVisible
public boolean isRuntimeVisible()- Specified by:
isRuntimeVisible
in interfaceAnnotationAJ
- Specified by:
isRuntimeVisible
in classAbstractAnnotationAJ
- Returns:
- true if the annotation is marked for runtime visibility
-
stringify
- Specified by:
stringify
in interfaceAnnotationAJ
- Specified by:
stringify
in classAbstractAnnotationAJ
- Returns:
- String form of the annotation and any values, eg. @Foo(a=b,c=d)
-
toString
-
hasNamedValue
- Specified by:
hasNamedValue
in interfaceAnnotationAJ
- Specified by:
hasNamedValue
in classAbstractAnnotationAJ
- Parameters:
n
- the name of the value- Returns:
- true if there is a value with that name
-
hasNameValuePair
- Specified by:
hasNameValuePair
in interfaceAnnotationAJ
- Specified by:
hasNameValuePair
in 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:
getTargets
in interfaceAnnotationAJ
- Specified by:
getTargets
in 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
-