java.lang.Object
org.codehaus.modello.plugin.java.javasource.JComment

public class JComment extends Object
A class that represents a Java comment.
Version:
$Revision$ $Date$
Author:
Keith Visco
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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, but starts with: \/**
    static final short
    The line comment style: \/\/
    protected static final int
    The maximum number of characters per line
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Java Comment
    JComment(short style)
    Creates a new Java comment with the given style
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the comment String to this JDocComment
    void
    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
    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 Details

    • AUTO_STYLE

      public static final short AUTO_STYLE
      The auto style, allows this JComment to automatically choose a style for this comment
      See Also:
    • BLOCK_STYLE

      public static final short BLOCK_STYLE
      The block comment style: \/* *\/
      See Also:
    • LINE_STYLE

      public static final short LINE_STYLE
      The line comment style: \/\/
      See Also:
    • 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:
    • JAVADOC_STYLE

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

      protected static final int MAX_LENGTH
      The 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

      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
      Overrides:
      toString in class Object
      Returns:
      the String representation of this Java Doc Comment