public abstract class Comment extends Node
BlockComment,
LineComment,
JavadocCommentNode.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversalABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY| Constructor and Description |
|---|
Comment(String content) |
Comment(TokenRange tokenRange,
String content)
This constructor is used by the parser and is considered private.
|
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findByRange, findCompilationUnit, findData, findFirst, findFirst, findFirst, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walkfinalize, getClass, notify, notifyAll, wait, wait, waitfindAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOfcontainsWithin, containsWithinRange, getBegin, getEnd, hasRangepublic Comment(String content)
public Comment(TokenRange tokenRange, String content)
public 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()
public Node setComment(Comment comment)
NodesetComment in class Nodecomment - to be setpublic boolean remove()
Nodepublic Node findRootNode()
NodefindRootNode in class Nodepublic CommentMetaModel getMetaModel()
getMetaModel in class Nodepublic boolean isBlockComment()
public BlockComment asBlockComment()
public boolean isJavadocComment()
public JavadocComment asJavadocComment()
public void ifBlockComment(Consumer<BlockComment> action)
public void ifJavadocComment(Consumer<JavadocComment> action)
public void ifLineComment(Consumer<LineComment> action)
public Optional<BlockComment> toBlockComment()
public Optional<JavadocComment> toJavadocComment()
public Optional<LineComment> toLineComment()
public abstract String getHeader()
public abstract String getFooter()
public String asString()
Copyright © 2007–2024. All rights reserved.