com.infoengine.xml
Class XMLSAXReader

java.lang.Object
  extended bycom.infoengine.xml.XMLSAXReader

public class XMLSAXReader
extends Object


Field Summary
private  InputSource myDoc
           
private  I_readIeObjectXML myDocHandler
           
private static String parserClass
           
 
Constructor Summary
XMLSAXReader()
           
 
Method Summary
 int getErrorLevel()
          Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values.
 IeObject getIeObject()
           Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values.
 String getStringOutput()
           Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values.
static void main(String[] args)
           
private  IeObject runTheParser()
           This method will not be implemented as there is no utility if StringOutput is available.
 void setDocumentHandler(String handlerClassName)
           Input: A string representing a classname that corresponds to an InfoEngine class file that will handle the actual processing of the XML inputstream represented by INPUTDOCUMENT.
 void setInputDocument(InputStream in)
           Input: A InputStream object resenting a set of XML that needs to be read by the SAX parser.
 void setInputDocument(Reader isr)
           Input: A Reader object representing a stream that needs to be read by the SAX parser.
 void setInputDocument(String in)
           Input: A String object resenting a set of XML that needs to be read by the SAX parser.
 void setInputDocument(URL in)
           Input: A URL object resenting a set of XML that needs to be read by the SAX parser.
 void setParserClass(String parserClassName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parserClass

private static String parserClass

myDoc

private InputSource myDoc

myDocHandler

private I_readIeObjectXML myDocHandler
Constructor Detail

XMLSAXReader

public XMLSAXReader()
             throws Exception
Method Detail

setParserClass

public void setParserClass(String parserClassName)
                    throws ClassNotFoundException
Throws:
ClassNotFoundException

setInputDocument

public void setInputDocument(Reader isr)
Input: A Reader object representing a stream that needs to be read by the SAX parser. Output: None. Process: Open the file or string reader and create a class org.xml.sax.InputSource object, INPUTDOCUMENT from it. Throw the IOException as necessary.

See Also:
InputSource

setInputDocument

public void setInputDocument(InputStream in)
Input: A InputStream object resenting a set of XML that needs to be read by the SAX parser. Output: None. Process: Create a class org.xml.sax.InputSource object, INPUTDOCUMENT from it. Throw the IOException as necessary.

See Also:
InputSource

setInputDocument

public void setInputDocument(URL in)
                      throws IOException
Input: A URL object resenting a set of XML that needs to be read by the SAX parser. Output: None. Process: Open a Reader object and create a class org.xml.sax.InputSource object, INPUTDOCUMENT from it. Throw the IOException as necessary.

Throws:
IOException
See Also:
InputSource

setInputDocument

public void setInputDocument(String in)
Input: A String object resenting a set of XML that needs to be read by the SAX parser. Output: None. Process: convert the String to a CharArrayReader and create a class org.xml.sax.InputSource object, INPUTDOCUMENT from it. Throw the IOException as necessary.

See Also:
InputSource

setDocumentHandler

public void setDocumentHandler(String handlerClassName)
                        throws Exception
Input: A string representing a classname that corresponds to an InfoEngine class file that will handle the actual processing of the XML inputstream represented by INPUTDOCUMENT. Output: None. Process: Attempt to do a classForName on the passed string. If the class exists, set a class variable, DOCUMENTHANDLER to hold it. Otherwise, throw the resultant ClassNotFoundException.

Throws:
Exception
See Also:
DocumentHandler

getStringOutput

public String getStringOutput()
                       throws Exception
Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values. Output: A String object representing the finished processing of INPUTDOCUMENT by the DOCUMENTHANDLER. Process: See the main section of this code for the process.

Throws:
Exception
See Also:
DocumentHandler, InputSource, Parser

getIeObject

public IeObject getIeObject()
                     throws Exception
Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values. Output: An IeObject that represents the XML stream processing of INPUTDOCUMENT by the DOCUMENTHANDLER. The output must be cast if a specific type of IeObject is expected. Process: See the main section of this code for the process.

Throws:
Exception
See Also:
DocumentHandler, InputSource, Parser

getErrorLevel

public int getErrorLevel()
Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values. Output: An int representing the error level encountered in the processing of INPUTDOCUMENT by the DOCUMENTHANDLER. Process: See the main section of this code for the process.

See Also:
DocumentHandler, InputSource, Parser

runTheParser

private IeObject runTheParser()
                       throws Exception
This method will not be implemented as there is no utility if StringOutput is available. CMPiv 02-06-99 Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values. Output: A ByteArrayOutputStream object representing the finished processing of INPUTDOCUMENT by the DOCUMENTHANDLER. Process: See the main section of this code for the process.

Throws:
Exception
See Also:
DocumentHandler, InputSource, Parser

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception