public class ASTJAnnotation extends ASTJNode<Annotation> implements JAnnotation
Annotation
object. ASTJAnnotation nodes are
children of ASTJMember
.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contents
Cached contents of this annotation
|
isCommentedOut, name, rewriter, UNITIALIZED_STRING
EMPTY_STRING_ARRAY, qualifiedName
Modifier | Constructor and Description |
---|---|
protected |
ASTJAnnotation(Annotation annotation) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
java.lang.String |
getContents()
Get the original contents of the node using the source.
|
java.lang.String |
getName()
Returns name of annotation type with preceding @ sign.
|
protected Annotation |
getRewrittenASTNode() |
void |
setContents(java.lang.String contents)
Overwrites the contents of the annotation with the given contents.
|
void |
setName(java.lang.String name)
Sets the name of annotation type.
|
protected void |
setRewrittenASTNode(Annotation rewrittenAnnotation) |
addChild, addValueToListProperty, addValueToListProperty, ancestorInserted, ancestorToBeRemoved, childToBeChanged, combineArrayAndList, commentOut, convertASTNodeListToStringArray, disableTrackAndReplace, enableTrackAndReplace, getASTNode, getFacadeHelper, getParent, getRemovedASTNode, getRewriter, getWrappedObject, insert, insertFirst, insertLast, insertSibling, isDisposed, nodeToBeMoved, nodeToBeRemoved, remove, remove, removeNodeFromListProperty, removeTrackAndReplace, setASTNode, setFacadeHelper, setFlags, setListNodeProperty, setNodeProperty, setNodeProperty, setParent, setRemovedASTNode, setRewriter, setTrackedNodeProperty, setWrappedObject, trackAndReplace
computeQualifiedName, computeQualifiedName, computeQualifiedName, computeQualifiedName, getChildren, getFlags, getName, getQualifiedName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildren, getFlags, getParent, getQualifiedName, setFlags
protected java.lang.String contents
getContents()
,
setContents(String)
protected ASTJAnnotation(Annotation annotation)
annotation
- protected Annotation getRewrittenASTNode()
protected void setRewrittenASTNode(Annotation rewrittenAnnotation)
rewrittenAnnotation
- the annotation to use in set methodspublic java.lang.String getName()
getName
in interface JNode
null
if it has no nameJNode.getName()
public void setName(java.lang.String name)
setName
in interface JNode
name
- name to setJNode.setName(java.lang.String)
public java.lang.String getContents()
ASTJNode
The contents of the node in AST implementation includes only the node itself without the leading or trailing whitespace. If the node has a Javadoc comment, it is included in the contents. No other leading or trailing comments are included in the node contents.
Note that this method returns the contents before any modifications. This method will not return the correct contents if the node has been cloned, removed or moved.
getContents
in interface JNode
getContents
in class ASTJNode<Annotation>
null
if this node has no contentsJNode.getContents()
public void setContents(java.lang.String contents)
JAnnotation
setContents
in interface JAnnotation