Package org.codehaus.janino.util
Class AutoIndentWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.codehaus.janino.util.AutoIndentWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class AutoIndentWriter extends FilterWriter
AFilterWriterthat automatically indents lines by looking at trailing opening braces ('{') and leading closing braces ('}').
-
-
Field Summary
Fields Modifier and Type Field Description static charCLEAR_TABULATORSSpecial character indicating to clear all tabluar layout that was configured throughTABULATOR.static charINDENTSpecial character that inserts a line break and indents the following text by one position.static charTABULATORSpecial character indicating a tabular layout of the following text.static charUNINDENTSpecial character that inserts a line break and unindents the following text by one position.-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description AutoIndentWriter(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(String str, int off, int len)
-
-
-
Field Detail
-
TABULATOR
public static final char TABULATOR
Special character indicating a tabular layout of the following text.- See Also:
- Constant Field Values
-
CLEAR_TABULATORS
public static final char CLEAR_TABULATORS
Special character indicating to clear all tabluar layout that was configured throughTABULATOR.- See Also:
- Constant Field Values
-
INDENT
public static final char INDENT
Special character that inserts a line break and indents the following text by one position.- See Also:
- Constant Field Values
-
UNINDENT
public static final char UNINDENT
Special character that inserts a line break and unindents the following text by one position.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutoIndentWriter
public AutoIndentWriter(Writer out)
-
-
Method Detail
-
write
public void write(@Nullable char[] cbuf, int off, int len) throws IOException
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(@Nullable String str, int off, int len) throws IOException
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(int c) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterWriter- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classFilterWriter- Throws:
IOException
-
-