com.moesol.generator.core
Class IndentPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by com.moesol.generator.core.IndentPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class IndentPrintWriter
extends PrintWriter


Field Summary
protected  int m_indent
          Current indent level.
protected  int m_indentSize
          Number of spaces to print for each indent level.
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
IndentPrintWriter(OutputStream os)
           
IndentPrintWriter(Writer w)
           
 
Method Summary
 int getIndentSize()
           
 void indent()
          Increases the indent level.
 void outdent()
          Decreases the indent level.
 void printdent()
          Prints the spaces needed for the current indent level.
 void quote(String s)
          Prints quotes around a string
 void setIndentSize(int i)
          Sets how many spaces each indent level will be.
 
Methods inherited from class java.io.PrintWriter
append, append, append, append, append, append, append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_indentSize

protected int m_indentSize
Number of spaces to print for each indent level. Spaces printed by printdent are m_indent * m_indentSize.


m_indent

protected int m_indent
Current indent level.

Constructor Detail

IndentPrintWriter

public IndentPrintWriter(OutputStream os)

IndentPrintWriter

public IndentPrintWriter(Writer w)
Method Detail

setIndentSize

public void setIndentSize(int i)
Sets how many spaces each indent level will be.

Parameters:
i - new indent level.

getIndentSize

public int getIndentSize()
Returns:
number of spaces printed for each indent level.

indent

public void indent()
Increases the indent level.


outdent

public void outdent()
Decreases the indent level.


printdent

public void printdent()
Prints the spaces needed for the current indent level. The number of spaces is computed by m_indent * m_indentSize.


quote

public void quote(String s)
Prints quotes around a string

Parameters:
s - String to be quoted.


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.