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_WARNINGend, 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, setDeclaringTypecopyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, writeLocationpublic 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.Objectpublic java.lang.Object accept(PatternNodeVisitor visitor, java.lang.Object data)
accept in class PatternNodepublic void resolve(IScope scope)
Declarepublic Declare parameterizeWith(java.util.Map<java.lang.String,UnresolvedType> typeVariableBindingMap, World w)
DeclareparameterizeWith in class Declarepublic boolean isAdviceLike()
DeclareisAdviceLike in class Declarepublic 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void write(CompressingDataOutputStream s) throws java.io.IOException
write in class PatternNodejava.io.IOExceptionpublic static Declare read(VersionedDataInputStream s, ISourceContext context) throws java.io.IOException
java.io.IOExceptionpublic 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 Declarepublic void setRemover(boolean b)
public boolean isRemover()