Package org.aspectj.weaver.bcel
Class BcelAnnotation
java.lang.Object
org.aspectj.weaver.AbstractAnnotationAJ
org.aspectj.weaver.bcel.BcelAnnotation
- All Implemented Interfaces:
AnnotationAJ
Wraps a Bcel Annotation object and uses it to answer AnnotationAJ method calls. This is cheaper than translating all Bcel
annotations into AnnotationAJ objects.
- 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
ConstructorDescriptionBcelAnnotation(AnnotationGen theBcelAnnotation, ResolvedType resolvedAnnotationType)
BcelAnnotation(AnnotationGen theBcelAnnotation, World world)
-
Method Summary
Modifier and TypeMethodDescriptiongetStringFormOfValue(String name)
Determine the string representation of the value of a field.boolean
hasNamedValue(String name)
boolean
hasNameValuePair(String name, String value)
boolean
toString()
Methods inherited from class org.aspectj.weaver.AbstractAnnotationAJ
allowedOnAnnotationType, allowedOnField, allowedOnRegularType, ensureAtTargetInitialized, getType, getTypeName, getTypeSignature, getValidTargets, specifiesTarget
-
Constructor Details
-
BcelAnnotation
-
BcelAnnotation
-
-
Method Details
-
toString
-
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.
-
hasNameValuePair
- Specified by:
hasNameValuePair
in interfaceAnnotationAJ
- Specified by:
hasNameValuePair
in classAbstractAnnotationAJ
- Parameters:
name
- the name of the annotation fieldvalue
- the value of the annotation field- Returns:
- true if there is a value with the specified name and value
-
hasNamedValue
- Specified by:
hasNamedValue
in interfaceAnnotationAJ
- Specified by:
hasNamedValue
in classAbstractAnnotationAJ
- Parameters:
name
- the name of the value- Returns:
- true if there is a value with that name
-
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)
-
isRuntimeVisible
public boolean isRuntimeVisible()- Specified by:
isRuntimeVisible
in interfaceAnnotationAJ
- Specified by:
isRuntimeVisible
in classAbstractAnnotationAJ
- Returns:
- true if the annotation is marked for runtime visibility
-
getBcelAnnotation
- Returns:
- return the real bcel annotation being wrapped
-
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
-