Package org.aspectj.weaver.patterns
Class DeclareAnnotation
java.lang.Object
org.aspectj.weaver.patterns.PatternNode
org.aspectj.weaver.patterns.Declare
org.aspectj.weaver.patterns.DeclareAnnotation
- All Implemented Interfaces:
IHasPosition,IHasSourceLocation
Represents a declare annotation statement, one of atField, atMethod, atConstructor or atType.
- Author:
- Andy Clement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCaptures type of declare annotation (method/type/field/constructor) -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DeclareAnnotation.Kindstatic DeclareAnnotation.Kindstatic DeclareAnnotation.Kindstatic DeclareAnnotation.Kindstatic DeclareAnnotation.KindFields inherited from class org.aspectj.weaver.patterns.Declare
ANNOTATION, DOMINATES, ERROR_OR_WARNING, PARENTS, PARENTSMIXIN, SOFT, TYPE_ERROR_OR_WARNINGFields inherited from class org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start -
Constructor Summary
ConstructorsConstructorDescriptionDeclareAnnotation(DeclareAnnotation.Kind kind, ISignaturePattern sigPattern)Constructor for declare atMethod/atField/atConstructor.DeclareAnnotation(DeclareAnnotation.Kind kind, TypePattern typePattern)Constructor for declare atType. -
Method Summary
Modifier and TypeMethodDescriptionaccept(PatternNodeVisitor visitor, Object data)voidcopyAnnotationTo(ResolvedType onType)booleancouldEverMatch(ResolvedType type)Return true if this declare annotation could ever match something in the specified type - only really able to make intelligent decision if a type was specified in the sig/type pattern signature.booleanintintReturns the string, useful before the real annotation has been resolvedgetKind()Provide a name suffix so that we can tell the different declare annotations forms apart in the AjProblemReporterinthashCode()booleanIndicates if this declare should be treated like advice.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanmatches(ResolvedMember resolvedmember, World world)For declare atConstructor, atMethod, atFieldbooleanmatches(ResolvedType type)For declare atType.parameterizeWith(Map<String,UnresolvedType> typeVariableBindingMap, World w)Returns a version of this declare element in which all references to type variables are replaced with their bindings given in the map.static Declareread(VersionedDataInputStream s, ISourceContext context)voidReturns this declare mutatedvoidsetAnnotationLocation(int start, int end)voidsetAnnotationMethod(String methodName)voidsetAnnotationString(String annotationString)voidsetAspect(ResolvedType typeX)voidsetRemover(boolean b)toString()voidMethods inherited from class org.aspectj.weaver.patterns.Declare
getDeclaringType, setDeclaringTypeMethods inherited from class org.aspectj.weaver.patterns.PatternNode
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, writeLocation
-
Field Details
-
AT_TYPE
-
AT_FIELD
-
AT_METHOD
-
AT_CONSTRUCTOR
-
AT_REMOVE_FROM_FIELD
-
-
Constructor Details
-
DeclareAnnotation
Constructor for declare atType. -
DeclareAnnotation
Constructor for declare atMethod/atField/atConstructor.
-
-
Method Details
-
getAnnotationString
Returns the string, useful before the real annotation has been resolved -
isExactPattern
public boolean isExactPattern() -
getAnnotationMethod
-
toString
-
accept
- Specified by:
acceptin classPatternNode
-
resolve
Description copied from class:DeclareReturns this declare mutated -
parameterizeWith
Description copied from class:DeclareReturns a version of this declare element in which all references to type variables are replaced with their bindings given in the map.- Specified by:
parameterizeWithin classDeclare
-
isAdviceLike
public boolean isAdviceLike()Description copied from class:DeclareIndicates if this declare should be treated like advice. If true, the declare will have no effect in an abstract aspect. It will be inherited by any concrete aspects and will have an effect for each concrete aspect it is ultimately inherited by.- Specified by:
isAdviceLikein classDeclare
-
setAnnotationString
-
setAnnotationLocation
public void setAnnotationLocation(int start, int end) -
getAnnotationSourceStart
public int getAnnotationSourceStart() -
getAnnotationSourceEnd
public int getAnnotationSourceEnd() -
setAnnotationMethod
-
equals
-
hashCode
public int hashCode() -
write
- Specified by:
writein classPatternNode- Throws:
IOException
-
read
- Throws:
IOException
-
matches
For declare atConstructor, atMethod, atField -
matches
For declare atType. -
setAspect
-
getAspect
-
copyAnnotationTo
-
getAnnotation
-
getTypePattern
-
getSignaturePattern
-
isStarredAnnotationPattern
public boolean isStarredAnnotationPattern() -
getKind
-
isDeclareAtConstuctor
public boolean isDeclareAtConstuctor() -
isDeclareAtMethod
public boolean isDeclareAtMethod() -
isDeclareAtType
public boolean isDeclareAtType() -
isDeclareAtField
public boolean isDeclareAtField() -
getAnnotationType
- Returns:
- the type of the annotation
-
isAnnotationAllowedOnField
public boolean isAnnotationAllowedOnField()- Returns:
- true if the annotation specified is allowed on a field
-
getPatternAsString
-
couldEverMatch
Return true if this declare annotation could ever match something in the specified type - only really able to make intelligent decision if a type was specified in the sig/type pattern signature. -
getNameSuffix
Provide a name suffix so that we can tell the different declare annotations forms apart in the AjProblemReporter- Specified by:
getNameSuffixin classDeclare
-
setRemover
public void setRemover(boolean b) -
isRemover
public boolean isRemover()
-