de.unkrig.commons.io
Class XMLFormatterWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by de.unkrig.commons.io.XMLFormatterWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class XMLFormatterWriter
extends java.io.FilterWriter

This FilterWriter scans the character stream for tags and inserts "artificial" line breaks as follows:

<a><b
Wrap between '>' and '<' and indent
</a><b
Wrap between '>' and '<'
<a/><b
Wrap between '>' and '<'
</a></b
Wrap between '>' and '<' and unindent
<a/></b
Wrap between '>' and '<' and unindent


Field Summary
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
XMLFormatterWriter(java.io.Writer out)
           
 
Method Summary
 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
 

Constructor Detail

XMLFormatterWriter

public XMLFormatterWriter(java.io.Writer out)
See Also:
XMLFormatterWriter
Method Detail

write

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

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