|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotationNode
public class AnnotationNode
Represents an annotation which can be attached to interfaces, classes, methods and fields.
| Field Summary | |
|---|---|
private static int |
ALL_TARGETS
|
private int |
allowedTargets
|
static int |
ANNOTATION_TARGET
|
private ClassNode |
classNode
|
static int |
CONSTRUCTOR_TARGET
|
static int |
FIELD_TARGET
|
static int |
LOCAL_VARIABLE_TARGET
|
private java.util.Map |
members
|
static int |
METHOD_TARGET
|
static int |
PARAMETER_TARGET
|
private boolean |
runtimeRetention
|
private boolean |
sourceRetention
|
static int |
TYPE_TARGET
|
private boolean |
valid
|
| Constructor Summary | |
|---|---|
AnnotationNode(ClassNode classNode)
|
|
| Method Summary | |
|---|---|
void |
addMember(java.lang.String name,
Expression value)
|
ClassNode |
getClassNode()
|
Expression |
getMember(java.lang.String name)
|
java.util.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(java.lang.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 java.lang.String |
targetToName(int target)
|
| Methods inherited from class org.codehaus.groovy.ast.ASTNode |
|---|
getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setSourcePosition, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_TARGET
public static final int CONSTRUCTOR_TARGET
public static final int METHOD_TARGET
public static final int FIELD_TARGET
public static final int PARAMETER_TARGET
public static final int LOCAL_VARIABLE_TARGET
public static final int ANNOTATION_TARGET
private static final int ALL_TARGETS
private final ClassNode classNode
private java.util.Map members
private boolean runtimeRetention
private boolean sourceRetention
private int allowedTargets
private boolean valid
| Constructor Detail |
|---|
public AnnotationNode(ClassNode classNode)
| Method Detail |
|---|
public ClassNode getClassNode()
public java.util.Map getMembers()
public Expression getMember(java.lang.String name)
public void addMember(java.lang.String name,
Expression value)
public void setMember(java.lang.String name,
Expression value)
public boolean isBuiltIn()
public boolean hasRuntimeRetention()
RetentionPolicy.
public void setRuntimeRetention(boolean flag)
RetentionPolicy.RUNTIME or if false
if the RetentionPolicy.CLASS.
flag - if true then current annotation is marked as having
RetentionPolicy.RUNTIME. If false then
the annotation has RetentionPolicy.CLASS.public boolean hasSourceRetention()
RetentionPolicy.SOURCE.
public void setSourceRetention(boolean flag)
RetentionPolicy.SOURCE.
public void setAllowedTargets(int bitmap)
public boolean isTargetAllowed(int target)
public void setValid(boolean flag)
flag - public boolean isValid()
public static final java.lang.String targetToName(int target)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||