|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.Comment
public abstract class Comment
Abstract base class for all AST nodes that represent comments.
There are exactly three kinds of comment:
line comments (LineComment
),
block comments (BlockComment
), and
doc comments (Javadoc
).
Comment: LineComment BlockComment Javadoc
Field Summary |
---|
Method Summary | |
---|---|
ASTNode |
getAlternateRoot()
Returns the root AST node that this comment occurs within, or null if none (or not recorded). |
boolean |
isBlockComment()
Returns whether this comment is a block comment ( BlockComment ). |
boolean |
isDocComment()
Returns whether this comment is a doc comment ( Javadoc ). |
boolean |
isLineComment()
Returns whether this comment is a line comment ( LineComment ). |
void |
setAlternateRoot(ASTNode root)
Returns the root AST node that this comment occurs within, or null if none (or not recorded). |
Methods inherited from class org.eclipse.jdt.core.dom.ASTNode |
---|
accept, copySubtree, copySubtrees, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final boolean isBlockComment()
BlockComment
).
true
if this is a block comment, and
false
otherwisepublic final boolean isLineComment()
LineComment
).
true
if this is a line comment, and
false
otherwisepublic final boolean isDocComment()
Javadoc
).
true
if this is a doc comment, and
false
otherwisepublic final ASTNode getAlternateRoot()
null
if none (or not recorded).
Typically, the comment nodes created while parsing a compilation
unit are not considered descendents of the normal AST
root, namely an CompilationUnit
. Instead, these
comment nodes exist outside the normal AST and each is
a root in its own right. This optional property provides
a well-known way to navigate from the comment to the
compilation unit in such cases. Note that the alternate root
property is not one of the comment node's children. It is simply a
reference to a node.
null
if nonesetAlternateRoot(ASTNode)
public final void setAlternateRoot(ASTNode root)
null
if none (or not recorded).
root
- the alternate root node, or null
if nonegetAlternateRoot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |