to.etc.util
Class IndentWriter
java.lang.Object
java.io.Writer
to.etc.util.IndentWriter
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable
- Direct Known Subclasses:
- XmlWriter
public class IndentWriter
- extends java.io.Writer
Handles indented writing for dumps and the like.
- Author:
- Frits Jalvingh
Created on May 3, 2004
Fields inherited from class java.io.Writer |
lock |
Methods inherited from class java.io.Writer |
append, append, append, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IndentWriter
public IndentWriter()
- Constructor
IndentWriter
public IndentWriter(java.io.Writer w)
IndentWriter
public IndentWriter(java.io.Writer w,
boolean dontclose)
init
public void init(java.io.Writer w,
int indentlevel)
isIndentEnabled
public boolean isIndentEnabled()
setIndentEnabled
public void setIndentEnabled(boolean indentEnabled)
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in class java.io.Writer
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Specified by:
flush
in class java.io.Writer
- Throws:
java.io.IOException
setInd
public void setInd(int i)
setSpacesPerIndent
public void setSpacesPerIndent(int spi)
writeRaw
public void writeRaw(java.lang.String s)
throws java.io.IOException
- Throws:
java.io.IOException
writeRaw
public void writeRaw(char[] buf,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException
writeRaw
public void writeRaw(java.lang.String buf,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException
indent
public void indent()
throws java.io.IOException
- Output as many spaces as needed to reach the current indent level.
- Throws:
java.io.IOException
write
public void write(char[] buf,
int off,
int len)
throws java.io.IOException
- Specified by:
write
in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(java.lang.String str)
throws java.io.IOException
- Overrides:
write
in class java.io.Writer
- Throws:
java.io.IOException
inc
public void inc()
dec
public void dec()
forceNewline
public void forceNewline()
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println()
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(java.lang.String s)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(java.lang.String s)
throws java.io.IOException
- Throws:
java.io.IOException
getWriter
public java.io.Writer getWriter()
getStdoutWriter
public static IndentWriter getStdoutWriter()