Represents an annotation which can be attached to interfaces, classes, methods, fields, parameters, and other places.
Modifiers | Name | Description |
---|---|---|
static int |
ANNOTATION_TARGET |
|
static int |
CONSTRUCTOR_TARGET |
|
static int |
FIELD_TARGET |
|
static int |
LOCAL_VARIABLE_TARGET |
|
static int |
METHOD_TARGET |
|
static int |
PACKAGE_TARGET |
|
static int |
PARAMETER_TARGET |
|
static int |
TYPE_PARAMETER_TARGET |
|
static int |
TYPE_TARGET |
|
static int |
TYPE_USE_TARGET |
Type | Name and description |
---|---|
Expression |
member |
Constructor and description |
---|
AnnotationNode
(ClassNode classNode) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addMember(String name, Expression value) |
|
ClassNode |
getClassNode() |
|
Expression |
getMember(String name) |
|
Map<String, Expression> |
getMembers() |
|
boolean |
hasClassRetention() Flag corresponding to RetentionPolicy.CLASS .
|
|
boolean |
hasRuntimeRetention() Flag corresponding to RetentionPolicy.RUNTIME . |
|
boolean |
hasSourceRetention() Flag corresponding to RetentionPolicy.SOURCE . |
|
boolean |
isBuiltIn() |
|
boolean |
isTargetAllowed(int target) |
|
void |
setAllowedTargets(int bitmap) |
|
void |
setClassRetention(boolean flag) Sets the internal flag if the current annotation has an explicit RetentionPolicy.CLASS . |
|
void |
setMember(String name, Expression value) |
|
void |
setRuntimeRetention(boolean flag) Sets the internal flag if the current annotation has RetentionPolicy.SOURCE . |
|
void |
setSourceRetention(boolean flag) Sets the internal flag if the current annotation has RetentionPolicy.SOURCE . |
|
static String |
targetToName(int target) |
Methods inherited from class | Name |
---|---|
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit |
Flag corresponding to RetentionPolicy.CLASS
.
This is the default when no RetentionPolicy
annotations are present.
Flag corresponding to RetentionPolicy.RUNTIME
.
Flag corresponding to RetentionPolicy.SOURCE
.
Sets the internal flag if the current annotation has an explicit RetentionPolicy.CLASS
.
flag
- if true then current annotation is marked as having
RetentionPolicy.CLASS
. Sets the internal flag if the current annotation has
RetentionPolicy.SOURCE
.
flag
- if true then current annotation is marked as having
RetentionPolicy.RUNTIME
. Sets the internal flag if the current annotation has RetentionPolicy.SOURCE
.
flag
- if true then current annotation is marked as having
RetentionPolicy.SOURCE
.Copyright © 2003-2021 The Apache Software Foundation. All rights reserved.