org.apache.beehive.controls.runtime.generator
Class IndentingWriter
Object
Writer
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 |
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 |
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
IndentingWriter
public IndentingWriter(Writer delegate)
IndentingWriter
public IndentingWriter(Writer delegate,
int indentLevel)
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