org.apache.beehive.controls.runtime.generator
Class IndentingWriter

Object
  extended by Writer
      extended by IndentingWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class IndentingWriter
extends Writer

The IndentingWriter class is a simple implementation of an indenting code writer


Field Summary
protected  int _indentLevel
           
protected  Writer _out
           
protected  int depth
          current depth: // depth = 0; { // depth now is 2 { // depth now is 4 } // depth now is 2 } // depth now is 0
 
Fields inherited from class Writer
lock
 
Constructor Summary
IndentingWriter(Writer delegate)
           
IndentingWriter(Writer delegate, int indentLevel)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(char[] cbuf, int off, int len)
           
 
Methods inherited from class Writer
append, append, append, write, write, write, write
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

depth

protected int depth
current depth:
 // depth = 0;
 {
   // depth now is 2
   {
     // depth now is 4
   }
   // depth now is 2
 }
 // depth now is 0
 


_out

protected Writer _out

_indentLevel

protected int _indentLevel
Constructor Detail

IndentingWriter

public IndentingWriter(Writer delegate)

IndentingWriter

public IndentingWriter(Writer delegate,
                       int indentLevel)
Method Detail

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException