org.formaria.xml.nanoxml
Class NanoXmlWriter

java.lang.Object
  extended by net.n3.nanoxml.XMLWriter
      extended by org.formaria.xml.nanoxml.NanoXmlWriter
All Implemented Interfaces:
XmlWriter

public class NanoXmlWriter
extends net.n3.nanoxml.XMLWriter
implements XmlWriter

Copyright (c) Formaria Ltd., 2008

$Revision: 2.2 $

License: see License.txt


Constructor Summary
NanoXmlWriter(java.io.OutputStream stream)
          ctor which takes the OutputStream as a parameter.
NanoXmlWriter(java.io.Writer writer)
          ctor which takes the Writer as a parameter.
 
Method Summary
 void setOutputStream(java.io.FileOutputStream fos)
          Set the OutputStream to be used by the write function.
 void write(XmlElement xml, boolean prettyPrint, int indent)
          Write the contents of an XmlElement out to the outputstream specified by setOutputStream
 
Methods inherited from class net.n3.nanoxml.XMLWriter
finalize, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NanoXmlWriter

public NanoXmlWriter(java.io.OutputStream stream)
ctor which takes the OutputStream as a parameter.

Parameters:
stream - The OutputStream to which the contents will be written

NanoXmlWriter

public NanoXmlWriter(java.io.Writer writer)
ctor which takes the Writer as a parameter.

Parameters:
writer - The Writer to which the contents will be written
Method Detail

write

public void write(XmlElement xml,
                  boolean prettyPrint,
                  int indent)
           throws java.io.IOException
Write the contents of an XmlElement out to the outputstream specified by setOutputStream

Specified by:
write in interface XmlWriter
Parameters:
xml - The root XmlElement to be output
prettyPrint - If true the XML will be output in a more readable format
indent - If true the XML will be indented
Throws:
java.io.IOException - Throw an IOException if anything goes wrong

setOutputStream

public void setOutputStream(java.io.FileOutputStream fos)
Set the OutputStream to be used by the write function. This needs to be set before writing.

Specified by:
setOutputStream in interface XmlWriter
Parameters:
fos - The FileOutputStream to which the XML will be written