Class JComment
java.lang.Object
org.codehaus.modello.plugin.java.javasource.JComment
A class that represents a Java comment.
- Version:
- $Revision$ $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringBuilderThe main comment for this JDocCommentprivate static final Stringstatic final shortThe auto style, allows this JComment to automatically choose a style for this commentstatic final shortThe block comment style: \/* *\/private static final Stringprivate static final Stringstatic final shortThe header style, similiar to block, but with an '*' at the start of each line.static final shortSimiliar to HEADER_STYLE, but starts with: \/**private static final Stringstatic final shortThe line comment style: \/\/protected static final intThe maximum number of characters per lineprivate static final Stringprivate static final Stringprivate static final Stringprivate shortThe style of this comment -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendComment(String comment) Appends the comment String to this JDocCommentvoidprint(JSourceWriter jsw) prints this JComment using the given JSourceWritervoidsetComment(String comment) Sets the comment String of this JDocCommentvoidsetStyle(short style) Sets the style for this JCommenttoString()Returns the String representation of this Java Doc Comment
-
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:
-
START_BLOCK
- See Also:
-
END_BLOCK
- See Also:
-
START_JAVADOC
- See Also:
-
END_JAVADOC
- See Also:
-
ASTERIX_PREFIX
- See Also:
-
LINE_COMMENT_PREFIX
- See Also:
-
SPACE_PREFIX
- See Also:
-
style
private short styleThe style of this comment -
_comment
The main comment for this JDocComment -
MAX_LENGTH
protected static final int MAX_LENGTHThe maximum number of characters per line- 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 comment style
-
-
Method Details
-
appendComment
Appends the comment String to this JDocComment- Parameters:
comment- the comment to append
-
print
prints this JComment using the given JSourceWriter- Parameters:
jsw- the JSourceWriter to print to
-
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
-
toString
Returns the String representation of this Java Doc Comment
-