T
- wrapped body declaration typepublic abstract class ASTJMember<T extends BodyDeclaration> extends ASTJNode<T> implements JMember
ASTJMember
has a reference to BodyDeclaration
as a wrapped object.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
comment
Cached value of member comment.
|
isCommentedOut, name, rewriter, UNITIALIZED_STRING
EMPTY_STRING_ARRAY, qualifiedName
Constructor and Description |
---|
ASTJMember(T bodyDeclaration) |
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(ASTJNode<?> child)
Adds a child to this node.
|
void |
dispose() |
protected java.util.List<JNode> |
getAnnotationList() |
java.util.List<JNode> |
getChildren()
Returns the children of this node.
|
java.lang.String |
getComment()
Returns the comment associated with this member (including comment delimiters).
|
int |
getFlags()
Returns original flags of the member.
|
protected void |
insertLastAnnotation(ASTJAnnotation annotation)
Insert annotation after the last annotation of the given body declaration.
|
boolean |
insertSibling(ASTJNode<?> node,
ASTJNode<?> newSibling,
boolean before)
Inserts
newSibling as a child of this node before or after the given node . |
boolean |
remove(ASTJNode<?> node)
Removes a node.
|
void |
setComment(java.lang.String comment)
Sets the comment associated with this member.
|
void |
setFlags(int flags)
Sets the flags of the member.
|
addValueToListProperty, addValueToListProperty, ancestorInserted, ancestorToBeRemoved, childToBeChanged, combineArrayAndList, commentOut, convertASTNodeListToStringArray, disableTrackAndReplace, enableTrackAndReplace, getASTNode, getContents, getFacadeHelper, getParent, getRemovedASTNode, getRewriter, getWrappedObject, insert, insertFirst, insertLast, isDisposed, nodeToBeMoved, nodeToBeRemoved, remove, removeNodeFromListProperty, removeTrackAndReplace, setASTNode, setFacadeHelper, setListNodeProperty, setNodeProperty, setNodeProperty, setParent, setRemovedASTNode, setRewriter, setTrackedNodeProperty, setWrappedObject, trackAndReplace
computeQualifiedName, computeQualifiedName, computeQualifiedName, computeQualifiedName, getName, getQualifiedName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContents, getName, getParent, getQualifiedName, setName
protected java.lang.String comment
getComment()
,
setComment(String)
public ASTJMember(T bodyDeclaration)
bodyDeclaration
- public int getFlags()
getFlags
in interface JNode
getFlags
in class AbstractJNode
AbstractJNode.getFlags()
public void setFlags(int flags)
Note that getFlags()
will not return the new value.
public java.lang.String getComment()
JMember
getComment
in interface JMember
null
if this member has no associated
commentpublic void setComment(java.lang.String comment)
JMember
null
comment indicates no comment.setComment
in interface JMember
comment
- the comment, including comment delimiters, or
null
indicating this member should have no associated commentpublic boolean remove(ASTJNode<?> node)
ASTJNode
Default implementation does nothing and returns false
.
public boolean insertSibling(ASTJNode<?> node, ASTJNode<?> newSibling, boolean before)
ASTJNode
newSibling
as a child of this node before or after the given node
.
Default implementation does nothing and returns false
.
insertSibling
in class ASTJNode<T extends BodyDeclaration>
newSibling
- to insertbefore
- true
if newSibling
must be before node
, false
if aftertrue
if operation successful, false
otherwisepublic boolean addChild(ASTJNode<?> child)
ASTJNode
Default implementation does nothing and returns false
.
public java.util.List<JNode> getChildren()
JNode
The list must be unmodifiable if the implementation doesn't support direct manipulation.
getChildren
in interface JNode
getChildren
in class AbstractJNode
protected java.util.List<JNode> getAnnotationList()
protected void insertLastAnnotation(ASTJAnnotation annotation)
Note that modifiers and annotations can alternate in the modifiers list. This method inserts the new annotation after the last existing annotation.
annotation
-