net.sf.jomic.tools
Class XmlTools

java.lang.Object
  extended by net.sf.jomic.tools.XmlTools

public final class XmlTools
extends java.lang.Object

Various utility methods to simplify processing XML data.

Author:
Thomas Aglassinger

Method Summary
 org.w3c.dom.Document createEmptyDocument(java.lang.String rootElementName)
          Create new XML document.
static XmlTools instance()
           
 void prettyPrint(java.io.File xmlFile)
          Pretty print xmlFile, replacing the original.
 void write(org.w3c.dom.Document document, java.io.Writer writer)
          Write document to writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static XmlTools instance()

createEmptyDocument

public org.w3c.dom.Document createEmptyDocument(java.lang.String rootElementName)
Create new XML document.

Parameters:
rootElementName - name of the root element to add, or null if the document should not have any root just yet

prettyPrint

public void prettyPrint(java.io.File xmlFile)
                 throws java.io.IOException,
                        org.xml.sax.SAXException
Pretty print xmlFile, replacing the original.

Throws:
java.io.IOException
org.xml.sax.SAXException

write

public void write(org.w3c.dom.Document document,
                  java.io.Writer writer)
           throws java.io.IOException
Write document to writer.

Throws:
java.io.IOException