org.codehaus.modello.generator.java.javasource

Class JComment

public class JComment extends Object

A class that represents a Java comment.

Version: $Revision: 149 $ $Date: 2004-09-29 13:32:16 -0400 (Wed, 29 Sep 2004) $

Author: Keith Visco

Field Summary
static shortAUTO_STYLE
The auto style, allows this JComment to automatically choose a style for this comment
static shortBLOCK_STYLE
The block comment style: \/* *\/
static shortHEADER_STYLE
The header style, similiar to block, but with an '*' at the start of each line.
static shortJAVADOC_STYLE
Similiar to HEADER_STYLE, but starts with: \/**
static shortLINE_STYLE
The line comment style: \/\/
protected static intMAX_LENGTH
The maximum number of characters per line
Constructor Summary
JComment()
Creates a new Java Comment
JComment(short style)
Creates a new Java comment with the given style
Method Summary
voidappendComment(String comment)
Appends the comment String to this JDocComment
voidprint(JSourceWriter jsw)
prints this JComment using the given JSourceWriter
voidsetComment(String comment)
Sets the comment String of this JDocComment
voidsetStyle(short style)
Sets the style for this JComment
StringtoString()
Returns the String representation of this Java Doc Comment

Field Detail

AUTO_STYLE

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

BLOCK_STYLE

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

HEADER_STYLE

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

JAVADOC_STYLE

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

LINE_STYLE

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

MAX_LENGTH

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

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(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(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 String toString()
Returns the String representation of this Java Doc Comment

Returns: the String representation of this Java Doc Comment

Copyright © 2001-2009 Codehaus. All Rights Reserved.