stomp.util
Class DocumentFactory

java.lang.Object
  |
  +--stomp.util.DocumentFactory

public class DocumentFactory
extends java.lang.Object

An xml factory, used for creating and obtaining Document objects. As creating documents is fairly time consuming operation, having this factory allows tehm to be instantiated on a low priority thread in the background. Also, it lets us switch implementations of the DOM interface without affecting any code but the stuff in this class.

Author:
Eric Lindauer

Constructor Summary
DocumentFactory()
           
 
Method Summary
static org.w3c.dom.Document getDocument()
          returns an empty Document object which can then be built up by the client.
static org.w3c.dom.Document getDocument(java.io.File xmlFile)
           
static org.w3c.dom.Document getDocument(java.io.InputStream input)
           
static org.w3c.dom.Document getDocument(java.lang.String fileLocation)
          retrieves the contents out of the named file, parses the contents, and returns the corresponding Document implementation.
static java.lang.String toString(org.w3c.dom.Node domNode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentFactory

public DocumentFactory()
Method Detail

getDocument

public static org.w3c.dom.Document getDocument(java.io.InputStream input)
                                        throws java.io.IOException,
                                               org.xml.sax.SAXException
Parameters:
xmlFileLocation - the path to the xml file to parse
Returns:
an implementation of the Document DOM interface. This document can be used to traverse the xml input file given.

getDocument

public static org.w3c.dom.Document getDocument()
                                        throws java.io.IOException
returns an empty Document object which can then be built up by the client.

getDocument

public static org.w3c.dom.Document getDocument(java.lang.String fileLocation)
                                        throws java.io.IOException,
                                               org.xml.sax.SAXException
retrieves the contents out of the named file, parses the contents, and returns the corresponding Document implementation. fileLocation is considered to be relative to the HCM/java directory in the current vu.

getDocument

public static org.w3c.dom.Document getDocument(java.io.File xmlFile)
                                        throws java.io.IOException,
                                               org.xml.sax.SAXException

toString

public static java.lang.String toString(org.w3c.dom.Node domNode)