Top Description Fields Constructors Methods
org.aspectj.weaver.bcel

public Class BcelAnnotation

extends AbstractAnnotationAJ
Class Inheritance
Imports
java.util.Collections, .HashSet, .List, .Set, org.aspectj.apache.bcel.classfile.annotation.AnnotationGen, .ArrayElementValue, .ElementValue, .EnumElementValue, .NameValuePair, org.aspectj.weaver.AbstractAnnotationAJ, .ResolvedType, .UnresolvedType, .World

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

Modifier and TypeField and Description
private final AnnotationGen
Inherited from org.aspectj.weaver.AbstractAnnotationAJ:
type

Constructor Summary

AccessConstructor and Description
public
BcelAnnotation(AnnotationGen theBcelAnnotation, World world)

public
BcelAnnotation(AnnotationGen theBcelAnnotation, ResolvedType resolvedAnnotationType)

Method Summary

Modifier and TypeMethod and Description
public AnnotationGen

Returns:

return the real bcel annotation being wrapped
getBcelAnnotation
()

public String
getStringFormOfValue(String
the name of the annotation field being looked up
name
)

Implements org.aspectj.weaver.AnnotationAJ.getStringFormOfValue.

Determine the string representation of the value of a field.
public Set<String>
public boolean
public boolean
hasNameValuePair(String
the name of the annotation field
name
,
String
the value of the annotation field
value
)

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.hasNameValuePair.

Implements org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

public boolean
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.aspectj.weaver.AbstractAnnotationAJ:
allowedOnAnnotationTypeallowedOnFieldallowedOnRegularTypeensureAtTargetInitializedgetTypegetTypeNamegetTypeSignaturegetValidTargetsspecifiesTarget

Field Detail

bcelAnnotationback to summary
private final AnnotationGen bcelAnnotation

Constructor Detail

BcelAnnotationback to summary
public BcelAnnotation(AnnotationGen theBcelAnnotation, World world)
BcelAnnotationback to summary
public BcelAnnotation(AnnotationGen theBcelAnnotation, ResolvedType resolvedAnnotationType)

Method Detail

getBcelAnnotationback to summary
public AnnotationGen getBcelAnnotation()
Returns:AnnotationGen

return the real bcel annotation being wrapped

getStringFormOfValueback to summary
public String getStringFormOfValue(String name)

Implements org.aspectj.weaver.AnnotationAJ.getStringFormOfValue.

Doc from org.aspectj.weaver.AnnotationAJ.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:String

the name of the annotation field being looked up

Returns:String

string representation of the value of that field, may be null if no such field set

getTargetsback to summary
public Set<String> getTargets()

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.getTargets.

Implements org.aspectj.weaver.AnnotationAJ.getTargets.

Returns:Set<String>

Doc from org.aspectj.weaver.AnnotationAJ.getTargets.

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.

Annotations
@Override
hasNamedValueback to summary
public boolean hasNamedValue(String name)

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.hasNamedValue.

Implements org.aspectj.weaver.AnnotationAJ.hasNamedValue.

Parameters
name:String

Doc from org.aspectj.weaver.AnnotationAJ.hasNamedValue.

the name of the value

Returns:boolean

Doc from org.aspectj.weaver.AnnotationAJ.hasNamedValue.

true if there is a value with that name

Annotations
@Override
hasNameValuePairback to summary
public boolean hasNameValuePair(String name, String value)

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.hasNameValuePair.

Implements org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

Parameters
name:String

Doc from org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

the name of the annotation field

value:String

Doc from org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

the value of the annotation field

Returns:boolean

Doc from org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

true if there is a value with the specified name and value

Annotations
@Override
isRuntimeVisibleback to summary
public boolean isRuntimeVisible()

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.isRuntimeVisible.

Implements org.aspectj.weaver.AnnotationAJ.isRuntimeVisible.

Returns:boolean

Doc from org.aspectj.weaver.AnnotationAJ.isRuntimeVisible.

true if the annotation is marked for runtime visibility

Annotations
@Override
stringifyback to summary
public String stringify()

Implements abstract org.aspectj.weaver.AbstractAnnotationAJ.stringify.

Implements org.aspectj.weaver.AnnotationAJ.stringify.

Returns:String

Doc from org.aspectj.weaver.AnnotationAJ.stringify.

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

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.