org.codehaus.modello.generator.java.javasource
Class JComment

java.lang.Object
  extended byorg.codehaus.modello.generator.java.javasource.JComment

public class JComment
extends java.lang.Object

A class that represents a Java comment.

Version:
$Revision: 149 $ $Date: 2004-09-29 19:32:16 +0200 (Wed, 29 Sep 2004) $
Author:
Keith Visco

Field Summary
private  java.lang.StringBuffer _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 Summary
JComment()
          Creates a new Java Comment
JComment(short style)
          Creates a new Java comment with the given style
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AUTO_STYLE

public static final short AUTO_STYLE
The auto style, allows this JComment to automatically choose a style for this comment

See Also:
Constant Field Values

BLOCK_STYLE

public static final short BLOCK_STYLE
The block comment style: \/* *\/

See Also:
Constant Field Values

LINE_STYLE

public static final short LINE_STYLE
The line comment style: \/\/

See Also:
Constant Field Values

HEADER_STYLE

public static final short HEADER_STYLE
The header style, similiar to block, but with an '*' at the start of each line.

See Also:
Constant Field Values

JAVADOC_STYLE

public static final short JAVADOC_STYLE
Similiar to HEADER_STYLE, but starts with: \/**

See Also:
Constant Field Values

START_BLOCK

private static final java.lang.String START_BLOCK
See Also:
Constant Field Values

END_BLOCK

private static final java.lang.String END_BLOCK
See Also:
Constant Field Values

START_JAVADOC

private static final java.lang.String START_JAVADOC
See Also:
Constant Field Values

END_JAVADOC

private static final java.lang.String END_JAVADOC
See Also:
Constant Field Values

ASTERIX_PREFIX

private static final java.lang.String ASTERIX_PREFIX
See Also:
Constant Field Values

LINE_COMMENT_PREFIX

private static final java.lang.String LINE_COMMENT_PREFIX
See Also:
Constant Field Values

SPACE_PREFIX

private static final java.lang.String SPACE_PREFIX
See Also:
Constant Field Values

style

private short style
The style of this comment


_comment

private java.lang.StringBuffer _comment
The main comment for this JDocComment


MAX_LENGTH

protected static final int MAX_LENGTH
The maximum number of characters per line

See Also:
Constant Field Values
Constructor Detail

JComment

public JComment()
Creates a new Java Comment


JComment

public JComment(short style)
Creates a new Java comment with the given style

Method Detail

appendComment

public void appendComment(java.lang.String comment)
Appends the comment String to this JDocComment

Parameters:
comment - the comment to append

print

public void print(JSourceWriter jsw)
prints this JComment using the given JSourceWriter

Parameters:
jsw - the JSourceWriter to print to

setComment

public void setComment(java.lang.String comment)
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

public java.lang.String toString()
Returns the String representation of this Java Doc Comment

Returns:
the String representation of this Java Doc Comment