public class JComment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.StringBuilder |
_comment
The main comment for this JDocComment
|
private static java.lang.String |
ASTERIX_PREFIX |
static short |
AUTO_STYLE
The auto style, allows this JComment to automatically
choose a style for this comment
|
static short |
BLOCK_STYLE
The block comment style: \/* *\/
|
private static java.lang.String |
END_BLOCK |
private static java.lang.String |
END_JAVADOC |
static short |
HEADER_STYLE
The header style, similiar to block, but with an '*'
at the start of each line.
|
static short |
JAVADOC_STYLE
Similiar to HEADER_STYLE, but starts with: \/**
|
private static java.lang.String |
LINE_COMMENT_PREFIX |
static short |
LINE_STYLE
The line comment style: \/\/
|
protected static int |
MAX_LENGTH
The maximum number of characters per line
|
private static java.lang.String |
SPACE_PREFIX |
private static java.lang.String |
START_BLOCK |
private static java.lang.String |
START_JAVADOC |
private short |
style
The style of this comment
|
Constructor and Description |
---|
JComment()
Creates a new Java Comment
|
JComment(short style)
Creates a new Java comment with the given style
|
Modifier and Type | Method and Description |
---|---|
void |
appendComment(java.lang.String comment)
Appends the comment String to this JDocComment
|
void |
print(JSourceWriter jsw)
prints this JComment using the given JSourceWriter
|
void |
setComment(java.lang.String comment)
Sets the comment String of this JDocComment
|
void |
setStyle(short style)
Sets the style for this JComment
|
java.lang.String |
toString()
Returns the String representation of this Java Doc Comment
|
public static final short AUTO_STYLE
public static final short BLOCK_STYLE
public static final short LINE_STYLE
public static final short HEADER_STYLE
public static final short JAVADOC_STYLE
private static final java.lang.String START_BLOCK
private static final java.lang.String END_BLOCK
private static final java.lang.String START_JAVADOC
private static final java.lang.String END_JAVADOC
private static final java.lang.String ASTERIX_PREFIX
private static final java.lang.String LINE_COMMENT_PREFIX
private static final java.lang.String SPACE_PREFIX
private short style
private java.lang.StringBuilder _comment
protected static final int MAX_LENGTH
public JComment()
public JComment(short style)
style
- the comment stylepublic void appendComment(java.lang.String comment)
comment
- the comment to appendpublic void print(JSourceWriter jsw)
jsw
- the JSourceWriter to print topublic void setComment(java.lang.String comment)
comment
- the comment String of this JDocCommentpublic void setStyle(short style)
style
- the style to use for this JCommentpublic java.lang.String toString()
toString
in class java.lang.Object