public final class Comment extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Comment.Style
The set of different comment types.
|
Modifier and Type | Method and Description |
---|---|
static Comment |
create(Comment.Style style,
int pos,
int endPos,
int indent,
String text)
Define a comment, using source file positions.
|
static Comment |
create(Comment.Style style,
String text)
Define a comment, using specified style.
|
static Comment |
create(String s)
Define a new block comment from a string.
|
int |
endPos()
The end position in the source file, or NOPOS if the
comment was added by a translation operation.
|
boolean |
equals(Object obj) |
String |
getText()
Returns the comment text.
|
int |
hashCode() |
int |
indent()
Returns the line indention for this comment, or NOPOS if the
comment was added by a translation operation.
|
boolean |
isDocComment()
Returns true if this is a JavaDoc comment.
|
boolean |
isNew() |
int |
pos()
The start position in the source file, or NOPOS if the
comment was added by a translation operation.
|
Comment.Style |
style() |
String |
toString() |
public static Comment create(String s)
s
- textual content of comment. With or without proper escapingpublic static Comment create(Comment.Style style, int pos, int endPos, int indent, String text)
style
- the style of commentpos
- start position within source fileendPos
- end position within source fileindent
- indentation of commenttext
- textual content of comment. With or without proper escapingpublic static Comment create(Comment.Style style, String text)
style
- the style of commentindent
- indentation of commenttext
- textual content of comment. With or without proper escapingpublic Comment.Style style()
public int pos()
public int endPos()
public int indent()
public boolean isDocComment()
public String getText()
public boolean isNew()
Built on May 31 2023. | Copyright © 2017-2023 Apache Software Foundation. All Rights Reserved.