Top Description Fields Constructors Methods
org.aspectj.weaver

public Class StandardAnnotation

extends AbstractAnnotationAJ
Class Inheritance
Imports
java.util.ArrayList, .Collections, .HashSet, .Iterator, .List, .Set

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

Modifier and TypeField and Description
private final boolean
private List<AnnotationNameValuePair>
Inherited from org.aspectj.weaver.AbstractAnnotationAJ:
type

Constructor Summary

AccessConstructor and Description
public
StandardAnnotation(ResolvedType type, boolean isRuntimeVisible)

Method Summary

Modifier and TypeMethod and Description
public void
public List<AnnotationNameValuePair>
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
n
,
String
the value of the annotation field
v
)

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

Implements org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

public boolean
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

isRuntimeVisibleback to summary
private final boolean isRuntimeVisible
nvPairsback to summary
private List<AnnotationNameValuePair> nvPairs

Constructor Detail

StandardAnnotationback to summary
public StandardAnnotation(ResolvedType type, boolean isRuntimeVisible)

Method Detail

addNameValuePairback to summary
public void addNameValuePair(AnnotationNameValuePair pair)
getNameValuePairsback to summary
public List<AnnotationNameValuePair> getNameValuePairs()
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.

hasNamedValueback to summary
public boolean hasNamedValue(String n)

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

Implements org.aspectj.weaver.AnnotationAJ.hasNamedValue.

Parameters
n: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

hasNameValuePairback to summary
public boolean hasNameValuePair(String n, String v)

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

Implements org.aspectj.weaver.AnnotationAJ.hasNameValuePair.

Parameters
n:String

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

the name of the annotation field

v: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

hasNameValuePairsback to summary
public boolean hasNameValuePairs()
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

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)

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.