Package org.codehaus.janino.util
Class AutoIndentWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.codehaus.janino.util.AutoIndentWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public class AutoIndentWriter extends java.io.FilterWriterAFilterWriterthat automatically indents lines by looking at trailing opening braces ('{') and leading closing braces ('}').
-
-
Field Summary
Fields Modifier and Type Field Description static charCLEAR_TABULATORSstatic charINDENTstatic charTABULATORstatic charUNINDENT
-
Constructor Summary
Constructors Constructor Description AutoIndentWriter(java.io.Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(java.lang.String str, int off, int len)
-
-
-
Field Detail
-
TABULATOR
public static final char TABULATOR
- See Also:
- Constant Field Values
-
CLEAR_TABULATORS
public static final char CLEAR_TABULATORS
- See Also:
- Constant Field Values
-
INDENT
public static final char INDENT
- See Also:
- Constant Field Values
-
UNINDENT
public static final char UNINDENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.FilterWriter- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.FilterWriter- Throws:
java.io.IOException
-
write
public void write(int c) throws java.io.IOException- Overrides:
writein classjava.io.FilterWriter- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterWriter- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.FilterWriter- Throws:
java.io.IOException
-
-