ca.quine.jcommons.sourcegen
Class CommentSource

java.lang.Object
  |
  +--ca.quine.jcommons.sourcegen.CommentSource
Direct Known Subclasses:
JavaDocCommentSource

public class CommentSource
extends Object


Field Summary
static String C_STYLE
           
static String INDENT_STYLE
          See Sun's JavaDoc page regarding indent.
protected  int indentLevel
           
static String JAVADOC_STYLE
           
protected  String style
           
protected  String text
           
 
Constructor Summary
CommentSource(int indentLevel, String style)
           
CommentSource(String style)
           
 
Method Summary
 int getIndentLevel()
           
 String getStyle()
           
 String getText()
           
 boolean isReformat()
           
 boolean isStarOnEachLine()
           
 boolean isUseSingleLineCommentIfPossible()
           
 void output(FormattingRules rules, StringBuffer buffer)
           
protected  void outputProtected(FormattingRules rules, StringBuffer buffer)
          Allow subclasses to take advantage of the text formatting without adding the "style" to the beginning and end of the buffer.
protected  void outputWithoutReformat(FormattingRules rules, StringBuffer buffer)
           
 void setIndentLevel(int indentLevel)
           
 void setReformat(boolean reformat)
           
 void setStarOnEachLine(boolean starOnEachLine)
           
 void setStyle(String style)
           
 void setText(String text)
           
 void setUseSingleLineCommentIfPossible(boolean useSingleLineCommentIfPossible)
          If JavaDoc style is used, this field will be ignored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVADOC_STYLE

public static final String JAVADOC_STYLE
See Also:
Constant Field Values

INDENT_STYLE

public static final String INDENT_STYLE
See Sun's JavaDoc page regarding indent.

See Also:
Constant Field Values

C_STYLE

public static final String C_STYLE
See Also:
Constant Field Values

indentLevel

protected int indentLevel

style

protected String style

text

protected String text
Constructor Detail

CommentSource

public CommentSource(String style)

CommentSource

public CommentSource(int indentLevel,
                     String style)
Method Detail

isReformat

public boolean isReformat()

setReformat

public void setReformat(boolean reformat)

getIndentLevel

public int getIndentLevel()

setIndentLevel

public void setIndentLevel(int indentLevel)

getStyle

public String getStyle()

setStyle

public void setStyle(String style)

isStarOnEachLine

public boolean isStarOnEachLine()

setStarOnEachLine

public void setStarOnEachLine(boolean starOnEachLine)

getText

public String getText()

setText

public void setText(String text)

isUseSingleLineCommentIfPossible

public boolean isUseSingleLineCommentIfPossible()

setUseSingleLineCommentIfPossible

public void setUseSingleLineCommentIfPossible(boolean useSingleLineCommentIfPossible)
If JavaDoc style is used, this field will be ignored.


output

public void output(FormattingRules rules,
                   StringBuffer buffer)

outputProtected

protected void outputProtected(FormattingRules rules,
                               StringBuffer buffer)
Allow subclasses to take advantage of the text formatting without adding the "style" to the beginning and end of the buffer. For example, JavaDocCommentSource can then add block tags before the end of the comment.

Parameters:
rules -
buffer -

outputWithoutReformat

protected void outputWithoutReformat(FormattingRules rules,
                                     StringBuffer buffer)