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:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class AutoIndentWriter
extends java.io.FilterWriter

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


Field Summary
static char ALIGN
           
static char FLUSH_TABBING
           
static char INDENT
           
static char UNINDENT
           
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
AutoIndentWriter(java.io.Writer out)
           
 
Method Summary
 void setPrefix(java.lang.String prefix)
          The prefix, if non-null, is printed between the indentation space and the line data.
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(java.lang.String str, int off, int len)
           
 
Methods inherited from class java.io.FilterWriter
close, flush
 
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

ALIGN

public static final char ALIGN
See Also:
Constant Field Values

FLUSH_TABBING

public static final char FLUSH_TABBING
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
Constructor Detail

AutoIndentWriter

public AutoIndentWriter(java.io.Writer out)
Method Detail

write

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

setPrefix

public void setPrefix(java.lang.String prefix)
The prefix, if non-null, is printed between the indentation space and the line data.


write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterWriter
Throws:
java.io.IOException

write

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

janino.net