com.infoengine.object.factory
Class GroupSAXreader

java.lang.Object
  extended bycom.infoengine.object.factory.GroupSAXreader

public class GroupSAXreader
extends Object


Field Summary
private  InputSource myDoc
           
private  I_readGroupXML myDocHandler
           
private static String parserClass
           
 
Constructor Summary
GroupSAXreader()
           
 
Method Summary
 int getErrorLevel()
          Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values.
 Group getGroup()
           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)
           
static Group readGroup(InputStream streamIn)
           
static Group readGroup(Reader readerIn)
           
static Group readGroup(String stringIn)
           
static Group readGroup(URL urlIn)
           
private  Group 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 FileReader object resenting a file 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_readGroupXML myDocHandler
Constructor Detail

GroupSAXreader

public GroupSAXreader()
Method Detail

setParserClass

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

setInputDocument

public void setInputDocument(Reader isr)
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

getGroup

public Group getGroup()
Input: Previously set, valid, PARSERCLASS, INPUTDOCUMENT, and DOCUMENTHANDLER values. Output: An Group that represents the XML stream processing of INPUTDOCUMENT by the DOCUMENTHANDLER. The output must be cast if a specific type of Group is expected. 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 Group 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

readGroup

public static Group readGroup(InputStream streamIn)

readGroup

public static Group readGroup(URL urlIn)

readGroup

public static Group readGroup(String stringIn)

readGroup

public static Group readGroup(Reader readerIn)

main

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