|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents an annotation which can be attached to interfaces, classes, methods and fields.
Field Summary | |
---|---|
int |
ALL_TARGETS
|
int |
ANNOTATION_TARGET
|
int |
CONSTRUCTOR_TARGET
|
int |
FIELD_TARGET
|
int |
LOCAL_VARIABLE_TARGET
|
int |
METHOD_TARGET
|
int |
PARAMETER_TARGET
|
int |
TYPE_TARGET
|
int |
allowedTargets
|
ClassNode |
classNode
|
Map |
members
|
boolean |
runtimeRetention
|
boolean |
sourceRetention
|
boolean |
valid
|
Constructor Summary | |
AnnotationNode(ClassNode classNode)
|
Method Summary | |
---|---|
void |
addMember(String name, Expression value)
|
ClassNode |
getClassNode()
|
Expression |
getMember(String name)
|
Map |
getMembers()
|
boolean |
hasRuntimeRetention()
Flag corresponding to RetentionPolicy .
|
boolean |
hasSourceRetention()
Flag corresponding to RetentionPolicy.SOURCE .
|
boolean |
isBuiltIn()
|
boolean |
isTargetAllowed(int target)
|
boolean |
isValid()
Returns the state of this annotation (verified and all verification passed). |
void |
setAllowedTargets(int bitmap)
|
void |
setMember(String name, Expression value)
|
void |
setRuntimeRetention(boolean flag)
Sets the internal flag of this annotation runtime retention policy. |
void |
setSourceRetention(boolean flag)
Sets the internal flag if the current annotation has RetentionPolicy.SOURCE .
|
void |
setValid(boolean flag)
Set if the current annotation is verified and passed all validations |
static String |
targetToName(int target)
|
Constructor Detail |
---|
public AnnotationNode(ClassNode classNode)
Method Detail |
---|
public void addMember(String name, Expression value)
public ClassNode getClassNode()
public Expression getMember(String name)
public Map getMembers()
public boolean hasRuntimeRetention()
RetentionPolicy
.
public boolean hasSourceRetention()
RetentionPolicy.SOURCE
.
public boolean isBuiltIn()
public boolean isTargetAllowed(int target)
public boolean isValid()
public void setAllowedTargets(int bitmap)
public void setMember(String name, Expression value)
public void setRuntimeRetention(boolean flag)
RetentionPolicy.RUNTIME
or if false
if the RetentionPolicy.CLASS
.
RetentionPolicy.RUNTIME
. If false then
the annotation has RetentionPolicy.CLASS
.
public void setSourceRetention(boolean flag)
RetentionPolicy.SOURCE
.
public void setValid(boolean flag)
public static String targetToName(int target)