Package org.aspectj.weaver
Interface AnnotationAJ
- All Known Implementing Classes:
AbstractAnnotationAJ
,BcelAnnotation
,StandardAnnotation
public interface AnnotationAJ
Simple representation of an annotation that the weaver can work with.
- Author:
- AndyClement
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
return true if this annotation can target an annotation typeboolean
boolean
getStringFormOfValue
(String name) Determine the string representation of the value of a field.getType()
boolean
hasNamedValue
(String name) boolean
hasNameValuePair
(String name, String value) boolean
boolean
-
Field Details
-
EMPTY_ARRAY
-
-
Method Details
-
getTypeSignature
String getTypeSignature()- Returns:
- the signature for the annotation type, eg. Lcom/foo/MyAnno;
-
getTypeName
String getTypeName()- Returns:
- the type name for the annotation, eg. com.foo.MyAnno
-
getType
ResolvedType getType()- Returns:
- the type of the annotation
-
allowedOnAnnotationType
boolean allowedOnAnnotationType()return true if this annotation can target an annotation type -
allowedOnField
boolean allowedOnField()- Returns:
- true if this annotation can be put on a field
-
allowedOnRegularType
boolean allowedOnRegularType()- Returns:
- true if this annotation can target a 'regular' type. A 'regular' type is enum/class/interface - it is *not* annotation.
-
getTargets
- 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.
-
hasNamedValue
- Parameters:
name
- the name of the value- Returns:
- true if there is a value with that name
-
hasNameValuePair
- 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
-
getValidTargets
String getValidTargets()- Returns:
- String representation of the valid targets for this annotation, eg. "{TYPE,FIELD}"
-
stringify
String stringify()- Returns:
- String form of the annotation and any values, eg. @Foo(a=b,c=d)
-
specifiesTarget
boolean specifiesTarget()- Returns:
- true if this annotation is marked with @target
-
isRuntimeVisible
boolean isRuntimeVisible()- Returns:
- true if the annotation is marked for runtime visibility
-
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
-