Package org.jf.util
Class IndentingWriter
- java.lang.Object
-
- java.io.Writer
-
- org.jf.util.IndentingWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class IndentingWriter extends java.io.Writer
-
-
Field Summary
Fields Modifier and Type Field Description protected char[]
buffer
protected int
indentLevel
protected java.io.Writer
writer
-
Constructor Summary
Constructors Constructor Description IndentingWriter(java.io.Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writer
append(char c)
java.io.Writer
append(java.lang.CharSequence charSequence)
java.io.Writer
append(java.lang.CharSequence charSequence, int start, int len)
void
close()
void
deindent(int indentAmount)
void
flush()
void
indent(int indentAmount)
void
write(char[] chars)
void
write(char[] chars, int start, int len)
void
write(int chr)
void
write(java.lang.String s)
void
write(java.lang.String str, int start, int len)
protected void
writeIndent()
-
-
-
Method Detail
-
writeIndent
protected void writeIndent() throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(int chr) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] chars) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] chars, int start, int len) throws java.io.IOException
- Specified by:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String s) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int start, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence charSequence) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence charSequence, int start, int len) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(char c) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
- Throws:
java.io.IOException
-
indent
public void indent(int indentAmount)
-
deindent
public void deindent(int indentAmount)
-
-