Package net.n3.nanoxml
Class XMLWriter
- java.lang.Object
-
- net.n3.nanoxml.XMLWriter
-
public class XMLWriter extends java.lang.Object
An XMLWriter writes XML data to a stream.- Author:
- Marc De Scheemaecker
- See Also:
IXMLElement
,Writer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
Cleans up the object when it's destroyed.void
write(IXMLElement xml)
Writes an XML element.void
write(IXMLElement xml, boolean prettyPrint)
Writes an XML element.void
write(IXMLElement xml, boolean prettyPrint, int indent)
Writes an XML element.void
write(IXMLElement xml, boolean prettyPrint, int indent, boolean collapseEmptyElements)
Writes an XML element.
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
Cleans up the object when it's destroyed.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
write
public void write(IXMLElement xml) throws java.io.IOException
Writes an XML element.- Parameters:
xml
- the non-null XML element to write.- Throws:
java.io.IOException
-
write
public void write(IXMLElement xml, boolean prettyPrint) throws java.io.IOException
Writes an XML element.- Parameters:
xml
- the non-null XML element to write.prettyPrint
- if spaces need to be inserted to make the output more readable- Throws:
java.io.IOException
-
write
public void write(IXMLElement xml, boolean prettyPrint, int indent) throws java.io.IOException
Writes an XML element.- Parameters:
xml
- the non-null XML element to write.prettyPrint
- if spaces need to be inserted to make the output more readableindent
- how many spaces to indent the element.- Throws:
java.io.IOException
-
write
public void write(IXMLElement xml, boolean prettyPrint, int indent, boolean collapseEmptyElements) throws java.io.IOException
Writes an XML element.- Parameters:
xml
- the non-null XML element to write.prettyPrint
- if spaces need to be inserted to make the output more readableindent
- how many spaces to indent the element.- Throws:
java.io.IOException
-
-