janino.net

org.codehaus.janino.util
Class AutoIndentWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by org.codehaus.janino.util.AutoIndentWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class AutoIndentWriter
extends FilterWriter

A FilterWriter that automatically indents lines by looking at trailing opening braces ('{') and leading closing braces ('}').


Field Summary
static char CLEAR_TABULATORS
          Special character indicating to clear all tabluar layout that was configured through TABULATOR.
static char INDENT
          Special character that inserts a line break and indents the following text by one position.
static char TABULATOR
          Special character indicating a tabular layout of the following text.
static char UNINDENT
          Special character that inserts a line break and unindents the following text by one position.
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
AutoIndentWriter(Writer out)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(String str, int off, int len)
           
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 through TABULATOR.

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(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(int c)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterWriter
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class FilterWriter
Throws:
IOException

janino.net