Class CDFormatter

  • Direct Known Subclasses:
    CDJavaFormatter

    public abstract class CDFormatter
    extends java.lang.Object
    Formats a code DOM and produces a source code. This object controls the formatting (such as indentation) and handles language-specific construct.
    Author:
    Kohsuke Kawaguchi (kk@kohsuke.org)
    • Constructor Detail

      • CDFormatter

        public CDFormatter​(java.io.Writer writer)
    • Method Detail

      • nl

        public CDFormatter nl()
                       throws java.io.IOException
        Clears the current line and this method also prints indentation.
        Returns:
        "this."
        Throws:
        java.io.IOException
      • p

        public CDFormatter p​(java.lang.String token)
                      throws java.io.IOException
        Outputs a new token. Sooner or later all the methods come down to this method for output.
        Returns:
        "this"
        Throws:
        java.io.IOException
      • p

        public CDFormatter p​(char ch)
                      throws java.io.IOException
        Outputs a new token.
        Returns:
        "this."
        Throws:
        java.io.IOException
      • express

        public CDFormatter express​(CDExpression exp)
                            throws java.io.IOException
        Prints expression.
        Throws:
        java.io.IOException
      • state

        public CDFormatter state​(CDStatement s)
                          throws java.io.IOException
        Prints a statement.
        Throws:
        java.io.IOException
      • type

        public final CDFormatter type​(CDType t)
                               throws java.io.IOException
        Outputs a type object.
        Throws:
        java.io.IOException
      • declare

        public final CDFormatter declare​(CDVariable v)
                                  throws java.io.IOException
        Outputs VariableDeclaration as a declaration.
        Throws:
        java.io.IOException
      • eos

        public CDFormatter eos()
                        throws java.io.IOException
        Marks the end of a statement.
        Throws:
        java.io.IOException