public class DeclareAnnotation extends Declare
Modifier and Type | Class and Description |
---|---|
static class |
DeclareAnnotation.Kind
Captures type of declare annotation (method/type/field/constructor)
|
Modifier and Type | Field and Description |
---|---|
static DeclareAnnotation.Kind |
AT_CONSTRUCTOR |
static DeclareAnnotation.Kind |
AT_FIELD |
static DeclareAnnotation.Kind |
AT_METHOD |
static DeclareAnnotation.Kind |
AT_REMOVE_FROM_FIELD |
static DeclareAnnotation.Kind |
AT_TYPE |
ANNOTATION, DOMINATES, ERROR_OR_WARNING, PARENTS, PARENTSMIXIN, SOFT, TYPE_ERROR_OR_WARNING
end, sourceContext, start
Constructor and Description |
---|
DeclareAnnotation(DeclareAnnotation.Kind kind,
ISignaturePattern sigPattern)
Constructor for declare atMethod/atField/atConstructor.
|
DeclareAnnotation(DeclareAnnotation.Kind kind,
TypePattern typePattern)
Constructor for declare atType.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
accept(PatternNodeVisitor visitor,
java.lang.Object data) |
void |
copyAnnotationTo(ResolvedType onType) |
boolean |
couldEverMatch(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.
|
boolean |
equals(java.lang.Object obj) |
AnnotationAJ |
getAnnotation() |
java.lang.String |
getAnnotationMethod() |
int |
getAnnotationSourceEnd() |
int |
getAnnotationSourceStart() |
java.lang.String |
getAnnotationString()
Returns the string, useful before the real annotation has been resolved
|
ResolvedType |
getAnnotationType() |
UnresolvedType |
getAspect() |
DeclareAnnotation.Kind |
getKind() |
java.lang.String |
getNameSuffix()
Provide a name suffix so that we can tell the different declare annotations forms apart in the AjProblemReporter
|
java.lang.String |
getPatternAsString() |
ISignaturePattern |
getSignaturePattern() |
TypePattern |
getTypePattern() |
int |
hashCode() |
boolean |
isAdviceLike()
Indicates if this declare should be treated like advice.
|
boolean |
isAnnotationAllowedOnField() |
boolean |
isDeclareAtConstuctor() |
boolean |
isDeclareAtField() |
boolean |
isDeclareAtMethod() |
boolean |
isDeclareAtType() |
boolean |
isExactPattern() |
boolean |
isRemover() |
boolean |
isStarredAnnotationPattern() |
boolean |
matches(ResolvedMember resolvedmember,
World world)
For declare atConstructor, atMethod, atField
|
boolean |
matches(ResolvedType type)
For declare atType.
|
Declare |
parameterizeWith(java.util.Map<java.lang.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 Declare |
read(VersionedDataInputStream s,
ISourceContext context) |
void |
resolve(IScope scope)
Returns this declare mutated
|
void |
setAnnotationLocation(int start,
int end) |
void |
setAnnotationMethod(java.lang.String methodName) |
void |
setAnnotationString(java.lang.String annotationString) |
void |
setAspect(ResolvedType typeX) |
void |
setRemover(boolean b) |
java.lang.String |
toString() |
void |
write(CompressingDataOutputStream s) |
getDeclaringType, setDeclaringType
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, writeLocation
public static final DeclareAnnotation.Kind AT_TYPE
public static final DeclareAnnotation.Kind AT_FIELD
public static final DeclareAnnotation.Kind AT_METHOD
public static final DeclareAnnotation.Kind AT_CONSTRUCTOR
public static final DeclareAnnotation.Kind AT_REMOVE_FROM_FIELD
public DeclareAnnotation(DeclareAnnotation.Kind kind, TypePattern typePattern)
public DeclareAnnotation(DeclareAnnotation.Kind kind, ISignaturePattern sigPattern)
public java.lang.String getAnnotationString()
public boolean isExactPattern()
public java.lang.String getAnnotationMethod()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object accept(PatternNodeVisitor visitor, java.lang.Object data)
accept
in class PatternNode
public void resolve(IScope scope)
Declare
public Declare parameterizeWith(java.util.Map<java.lang.String,UnresolvedType> typeVariableBindingMap, World w)
Declare
parameterizeWith
in class Declare
public boolean isAdviceLike()
Declare
isAdviceLike
in class Declare
public void setAnnotationString(java.lang.String annotationString)
public void setAnnotationLocation(int start, int end)
public int getAnnotationSourceStart()
public int getAnnotationSourceEnd()
public void setAnnotationMethod(java.lang.String methodName)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void write(CompressingDataOutputStream s) throws java.io.IOException
write
in class PatternNode
java.io.IOException
public static Declare read(VersionedDataInputStream s, ISourceContext context) throws java.io.IOException
java.io.IOException
public boolean matches(ResolvedMember resolvedmember, World world)
public boolean matches(ResolvedType type)
public void setAspect(ResolvedType typeX)
public UnresolvedType getAspect()
public void copyAnnotationTo(ResolvedType onType)
public AnnotationAJ getAnnotation()
public TypePattern getTypePattern()
public ISignaturePattern getSignaturePattern()
public boolean isStarredAnnotationPattern()
public DeclareAnnotation.Kind getKind()
public boolean isDeclareAtConstuctor()
public boolean isDeclareAtMethod()
public boolean isDeclareAtType()
public boolean isDeclareAtField()
public ResolvedType getAnnotationType()
public boolean isAnnotationAllowedOnField()
public java.lang.String getPatternAsString()
public boolean couldEverMatch(ResolvedType type)
public java.lang.String getNameSuffix()
getNameSuffix
in class Declare
public void setRemover(boolean b)
public boolean isRemover()