org.openeai.xml
Class XmlDocumentReader

java.lang.Object
  extended by org.openeai.OpenEaiObject
      extended by org.openeai.xml.XmlDocumentReader

public class XmlDocumentReader
extends OpenEaiObject

This class is used to create a JDOM Document object from the contents of an XML file that can be stored in a file (on a web server or local file system) or passed in as an in-memory representation of that file (Reader, InputStream).

Version:
3.0 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
XmlDocumentReader()
          Constructor
 
Method Summary
 org.jdom.Document initializeDocument(java.io.InputStream is, boolean validate)
          Creates a JDOM Document from the supplied InputStream.
 org.jdom.Document initializeDocument(java.io.Reader docAsReader, boolean validate)
          Creates a JDOM Document from the supplied Reader.
 org.jdom.Document initializeDocument(java.lang.String fileName, boolean validate)
          Creates a JDOM Document from the specified XML file name.
 
Methods inherited from class org.openeai.OpenEaiObject
getAppName, getDebug, getFromAddr, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDocumentReader

public XmlDocumentReader()
Constructor

Method Detail

initializeDocument

public final org.jdom.Document initializeDocument(java.lang.String fileName,
                                                  boolean validate)
                                           throws XmlDocumentReaderException
Creates a JDOM Document from the specified XML file name.

Example 1: http://www.somexmlserver.com/xml/AnXmlFile.xml

Example 2: file://localhost/xmlfiles/AnXmlFile.xml

Example 3: c:\xmlfiles\AnXmlFile.xml

Example 4: /opt/xmlfiles/AnXmlFile.xml

Parameters:
fileName - String the file name (can be in either URL format or local file system format)
validate - boolean flag indicating whether or not this method should also validate the contents of the document from an XML perspective (true=validate, false=don't validate)
Returns:
org.jdom.Document
Throws:
XmlDocumentReaderException

initializeDocument

public final org.jdom.Document initializeDocument(java.io.InputStream is,
                                                  boolean validate)
                                           throws XmlDocumentReaderException
Creates a JDOM Document from the supplied InputStream.

Parameters:
is - InputStream contents of the XML file that has been stored in the InputStream.
validate - boolean flag indicating whether or not this method should also validate the contents of the document from an XML perspective (true=validate, false=don't validate)
Returns:
org.jdom.Document
Throws:
XmlDocumentReaderException

initializeDocument

public final org.jdom.Document initializeDocument(java.io.Reader docAsReader,
                                                  boolean validate)
                                           throws XmlDocumentReaderException
Creates a JDOM Document from the supplied Reader.

Parameters:
docAsReader - Reader contents of the XML file that has been stored in the Reader.
validate - boolean flag indicating whether or not this method should also validate the contents of the document from an XML perspective (true=validate, false=don't validate)
Returns:
org.jdom.Document
Throws:
XmlDocumentReaderException


Copyright © 2002,2003 OpenEAI Software Foundation