com.infoengine.object
Class IeObjectSAXReader

java.lang.Object
  extended bycom.infoengine.object.IeObjectSAXReader

public class IeObjectSAXReader
extends Object


Field Summary
private  InputSource myDoc
           
private  I_readIeObjectXML myDocHandler
           
private static String parserClass
           
 
Constructor Summary
IeObjectSAXReader()
           
 
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)
           Input: A string representing a classname that corresponds to a SAX 1.0 compliant * parser.
 
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

IeObjectSAXReader

public IeObjectSAXReader()
Method Detail

setParserClass

public void setParserClass(String parserClassName)
                    throws ClassNotFoundException
Input: A string representing a classname that corresponds to a SAX 1.0 compliant * parser. Examples include: com.microstar.xml.SAXDriver (using the AElfred parser) and com.sun.xml.parser.ValidatingParser (using Sun's parser) Output: None. Process: Do a classForName on the passed string if the class-exists, set a class variable, PARSERCLASS, to hold it. otherwise, throw the resultant ClassNotFoundException

Throws:
ClassNotFoundException
See Also:
Parser

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 ClassNotFoundException,
                               InstantiationException,
                               IllegalAccessException
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:
ClassNotFoundException
InstantiationException
IllegalAccessException
See Also:
DocumentHandler

getStringOutput

public String getStringOutput()
                       throws IEException
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:
IEException
See Also:
DocumentHandler, InputSource, Parser

getIeObject

public IeObject getIeObject()
                     throws IEException
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:
IEException
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 IEException
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:
IEException
See Also:
DocumentHandler, InputSource, Parser

main

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