Package org.exolab.javasource
Class JComment
java.lang.Object
org.exolab.javasource.JComment
A class that represents a Java comment.
- Version:
- $Revision$ $Date: 2005-02-26 17:30:28 -0700 (Sat, 26 Feb 2005) $
- Author:
- Keith Visco
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final short
The auto style, allows this JComment to automatically choose a style for this comment.static final short
The block comment style.static final short
The header style, similiar to block, but with an '*' at the start of each line.static final short
Similiar to HEADER_STYLE.static final short
The line comment style.protected static final int
The maximum number of characters to indent comments.protected static final int
The maximum number of characters per line. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendComment
(String comment) Appends the comment String to this JDocComment.void
print
(JSourceWriter jsw) Prints this JComment using the given JSourceWriter.void
setComment
(String comment) Sets the comment String of this JDocComment.void
setStyle
(short style) Sets the style for this JComment.toString()
-
Field Details
-
AUTO_STYLE
public static final short AUTO_STYLEThe auto style, allows this JComment to automatically choose a style for this comment.- See Also:
-
BLOCK_STYLE
public static final short BLOCK_STYLEThe block comment style. \/* *\/- See Also:
-
LINE_STYLE
public static final short LINE_STYLEThe line comment style. \/\/- See Also:
-
HEADER_STYLE
public static final short HEADER_STYLEThe header style, similiar to block, but with an '*' at the start of each line.- See Also:
-
JAVADOC_STYLE
public static final short JAVADOC_STYLESimiliar to HEADER_STYLE. But starts with: \/**- See Also:
-
MAX_LENGTH
protected static final int MAX_LENGTHThe maximum number of characters per line.- See Also:
-
MAX_INDENT
protected static final int MAX_INDENTThe maximum number of characters to indent comments.- See Also:
-
-
Constructor Details
-
JComment
public JComment()Creates a new Java Comment. -
JComment
public JComment(short style) Creates a new Java comment with the given style.- Parameters:
style
- The desired style.
-
-
Method Details
-
appendComment
Appends the comment String to this JDocComment.- Parameters:
comment
- The comment to append.
-
setComment
Sets the comment String of this JDocComment.- Parameters:
comment
- The comment String of this JDocComment.
-
setStyle
public void setStyle(short style) Sets the style for this JComment.- Parameters:
style
- The style to use for this JComment.
-
print
Prints this JComment using the given JSourceWriter.- Parameters:
jsw
- The JSourceWriter to print to.
-
toString
-