public abstract class Comment extends Node
BlockComment,
LineComment,
JavadocCommentNode.ObserverRegistrationModeABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration| Modifier and Type | Method and Description |
|---|---|
LineComment |
asLineComment() |
Optional<Node> |
getCommentedNode() |
String |
getContent()
Return the text of the comment.
|
boolean |
isLineComment() |
boolean |
isOrphan() |
boolean |
remove()
Try to remove this node from the parent
|
Comment |
setCommentedNode(Node commentedNode)
Sets the commentedNode
|
Comment |
setContent(String content)
Sets the text of the comment.
|
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodeLists, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, hasJavaDocComment, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregisterfinalize, getClass, notify, notifyAll, wait, wait, waitgetAncestorOfType, setAsParentNodeOf, setAsParentNodeOfpublic final String getContent()
public Comment setContent(String content)
content - the text of the comment to setpublic boolean isLineComment()
public LineComment asLineComment()
public Comment setCommentedNode(Node commentedNode)
commentedNode - the commentedNode, can be nullpublic boolean isOrphan()
Copyright © 2007–2017. All rights reserved.