com.infoengine.xml
Class SAXreader

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

public class SAXreader
extends Object


Field Summary
private  InputSource myDoc
           
private  I_handleXML myDocHandler
           
private static String parserClass
           
 
Constructor Summary
SAXreader()
           
 
Method Summary
 int getErrorLevel()
          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  String 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(FileReader in)
           Input: A FileReader object resenting a file that needs to be read by the SAX parser.
 void setInputDocument(InputStream in)
           Input: A InputStream object resenting a set of XML 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_handleXML myDocHandler
Constructor Detail

SAXreader

public SAXreader()
Method Detail

setParserClass

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

setInputDocument

public void setInputDocument(FileReader in)
Input: A FileReader object resenting a file that needs to be read by the SAX parser. Output: None. Process: Open the file 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()
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.

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 String runTheParser()
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.

See Also:
DocumentHandler, InputSource, Parser

main

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