org.clapper.util.io
Class XMLWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.clapper.util.io.XMLWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class XMLWriter
extends java.io.Writer

XMLWriter is a filtering Writer class, designed to be used to write XML output. Basically, it performs some simple-minded indentation, to make the written XML a little more readable.

Version:
$Revision: 6735 $
See Also:
Writer

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
XMLWriter(java.io.PrintWriter out)
          Construct a new XMLWriter that will write its output to the specified PrintWriter object.
XMLWriter(java.io.Writer out)
          Construct a new XMLWriter that will write its output to the specified Writer object.
 
Method Summary
 void close()
          Close this Writer
 void flush()
          Flush this Writer
 void write(char[] ch, int off, int len)
          Write a portion of an array of characters.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

public XMLWriter(java.io.Writer out)
Construct a new XMLWriter that will write its output to the specified Writer object.

Parameters:
out - where the output should really go

XMLWriter

public XMLWriter(java.io.PrintWriter out)
Construct a new XMLWriter that will write its output to the specified PrintWriter object.

Parameters:
out - where the output should really go
Method Detail

close

public void close()
           throws java.io.IOException
Close this Writer

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException - I/O error

flush

public void flush()
           throws java.io.IOException
Flush this Writer

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException - I/O error

write

public void write(char[] ch,
                  int off,
                  int len)
           throws java.io.IOException
Write a portion of an array of characters.

Specified by:
write in class java.io.Writer
Parameters:
ch - array of characters
off - offset from which to start writing characters
len - number of characters to write
Throws:
java.io.IOException - I/O error


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.