Web Site

org.codehaus.janino.util
Class AutoIndentWriter

java.lang.Object
  extended byjava.io.Writer
      extended byjava.io.FilterWriter
          extended byorg.codehaus.janino.util.AutoIndentWriter

public class AutoIndentWriter
extends FilterWriter

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


Field Summary
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
AutoIndentWriter(Writer out)
           
 
Method Summary
 void indent()
           
 void setPrefix(String prefix)
          The prefix, if non-null, is printed between the indentation space and the line data.
 void unindent()
           
 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.FilterWriter
close, flush
 
Methods inherited from class java.io.Writer
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoIndentWriter

public AutoIndentWriter(Writer out)
Method Detail

write

public void write(int c)
           throws IOException
Throws:
IOException

unindent

public void unindent()

indent

public void indent()

setPrefix

public void setPrefix(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 IOException
Throws:
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Throws:
IOException

Web Site