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
typeFields inherited from interface org.aspectj.weaver.AnnotationAJ
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionBcelAnnotation(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.booleanhasNamedValue(String name)booleanhasNameValuePair(String name, String value)booleantoString()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:
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.
-
hasNameValuePair
- Specified by:
hasNameValuePairin interfaceAnnotationAJ- Specified by:
hasNameValuePairin 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:
hasNamedValuein interfaceAnnotationAJ- Specified by:
hasNamedValuein classAbstractAnnotationAJ- Parameters:
name- the name of the value- Returns:
- true if there is a value with that name
-
stringify
- Specified by:
stringifyin interfaceAnnotationAJ- Specified by:
stringifyin classAbstractAnnotationAJ- Returns:
- String form of the annotation and any values, eg. @Foo(a=b,c=d)
-
isRuntimeVisible
public boolean isRuntimeVisible()- Specified by:
isRuntimeVisiblein interfaceAnnotationAJ- Specified by:
isRuntimeVisiblein 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
-