ESC/Java2
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

escjava.vcGeneration
Class PrettyPrinter

java.lang.Object
  extended byescjava.vcGeneration.PrettyPrinter

public class PrettyPrinter
extends java.lang.Object


Field Summary
(package private)  java.lang.String commentMark
           
(package private)  java.lang.StringBuffer indentation
           
private  java.lang.String LBR
           
private  java.lang.String NL
           
(package private)  java.io.Writer out
           
private  java.lang.String RBR
           
private  java.lang.String TAB
           
 
Constructor Summary
PrettyPrinter(java.io.Writer out, java.lang.String tab, java.lang.String lbr, java.lang.String rbr, java.lang.String nl)
           
 
Method Summary
 java.io.Writer append(java.lang.String s)
          append indentation and parameter
 java.io.Writer appendI(java.lang.String s)
          This function goes to next line, increases indentation by two spaces and add a '(' If you want to change the indentation style do it here.
 java.io.Writer appendIwNl(java.lang.String s)
          This function increases indentation by two spaces and add a '(' If you want to change the indentation style do it here.
 java.io.Writer appendN(java.lang.String s)
          just append the parameter, N stands for normal
 java.io.Writer beginC(java.lang.String s)
          This adds a user-specified comment mark string to the beginning of each line.
 java.io.Writer endC()
          This function removes the comment mark set by setC() and appends a newline;
 java.io.Writer reduceI()
          This function goes to new line, add a ')' and reduces indentation by two spaces If you want to change the indentation style do it here.
 java.io.Writer reduceIwNl()
          This function add a ')' and reduces indentation by two spaces If you want to change the indentation style do it here.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAB

private final java.lang.String TAB

LBR

private final java.lang.String LBR

RBR

private final java.lang.String RBR

NL

private final java.lang.String NL

commentMark

java.lang.String commentMark

out

java.io.Writer out

indentation

java.lang.StringBuffer indentation
Constructor Detail

PrettyPrinter

public PrettyPrinter(java.io.Writer out,
                     java.lang.String tab,
                     java.lang.String lbr,
                     java.lang.String rbr,
                     java.lang.String nl)
Method Detail

appendN

public java.io.Writer appendN(java.lang.String s)
                       throws java.io.IOException
just append the parameter, N stands for normal

Throws:
java.io.IOException

append

public java.io.Writer append(java.lang.String s)
                      throws java.io.IOException
append indentation and parameter

Throws:
java.io.IOException

appendI

public java.io.Writer appendI(java.lang.String s)
                       throws java.io.IOException
This function goes to next line, increases indentation by two spaces and add a '(' If you want to change the indentation style do it here.

Throws:
java.io.IOException

appendIwNl

public java.io.Writer appendIwNl(java.lang.String s)
                          throws java.io.IOException
This function increases indentation by two spaces and add a '(' If you want to change the indentation style do it here.

Throws:
java.io.IOException

reduceI

public java.io.Writer reduceI()
                       throws java.io.IOException
This function goes to new line, add a ')' and reduces indentation by two spaces If you want to change the indentation style do it here.

Throws:
java.io.IOException

reduceIwNl

public java.io.Writer reduceIwNl()
                          throws java.io.IOException
This function add a ')' and reduces indentation by two spaces If you want to change the indentation style do it here.

Throws:
java.io.IOException

toString

public java.lang.String toString()

beginC

public java.io.Writer beginC(java.lang.String s)
                      throws java.io.IOException
This adds a user-specified comment mark string to the beginning of each line. It can be removed by wither recalling setC with the empty string or calling removeC. It immediately adds one instance of the comment marker.

Throws:
java.io.IOException

endC

public java.io.Writer endC()
                    throws java.io.IOException
This function removes the comment mark set by setC() and appends a newline;

Throws:
java.io.IOException

ESC/Java2
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage