com.infoengine.xml
Class IeSaxHandler

java.lang.Object
  extended bycom.infoengine.xml.IeSaxHandler
All Implemented Interfaces:
DocumentHandler, DTDHandler, ErrorHandler, I_readIeObjectXML

public class IeSaxHandler
extends Object
implements I_readIeObjectXML

Event handler class for SAX.

This handler processes the standard IE external formal xml

See Also:
EntityResolver, DTDHandler, DocumentHandler, ErrorHandler

Field Summary
private  IeObject answer
           
static String ATT_TAG
          Print a message for the start of an element.
private static int ATTR
           
private  Object attributeValue
           
static String COLLECTION_TAG
           
private  Stack contentTypeStack
           
private static int DATUM
           
static boolean DEBUG
           
private  int foundErrorLevel
           
static String GROUP_TAG
           
static String INSTANCE_TAG
           
private  Stack javaTypeStack
           
private  String lastTag
           
static String MESSAGE_TAG
           
private static int META
           
static String META_TAG
           
private static int NA
           
static String NAME_ATTRIBUTE
           
private  Object nilValue
           
private static int NODE
           
static String OBJECT_TYPE
           
private  Stack objectStack
           
private  StringBuffer returnData
           
private  Stack stateStack
           
private  Stack timeZoneStack
           
private  Stack typeStack
           
private  Stack valueStack
           
 
Fields inherited from interface com.infoengine.object.I_readIeObjectXML
PARSE_CRITICAL_ERROR, PARSE_OK, PARSE_RECOVERABLE_ERROR, PARSE_WARNING
 
Constructor Summary
IeSaxHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          Print a message for character data.
private static void display(String prefix, char[] ch, int start, int length)
          Display text, escaping some characters.
 void endDocument()
          Print a message for the end of the document.
 void endElement(String name)
          Print a message for the end of an element.
 void error(SAXParseException exception)
          Report all recoverable errors, and try to continue parsing.
 void fatalError(SAXParseException exception)
          Report all fatal errors, and try to continue parsing.
private  String getElement(String name, AttributeList atlist)
          Fish through the passed AttributeList to find a specified attribute by name.
 int getErrorLevel()
           
 String getErrorMessage()
           
 IeObject getIeObject()
           
 IeObject getOutput()
           
static byte[] hexToByte(String s)
           
 void ignorableWhitespace(char[] ch, int start, int length)
          Print a message for ignorable whitespace.
 void notationDecl(String name, String publicId, String systemId)
          Display notation declarations as they are reported.
 void processingInstruction(String target, String data)
          Print a message for a processing instruction.
 void setDocumentLocator(Locator locator)
          Print a message when the parser provides a locator.
 void startDocument()
          Initialize stack.
 void startElement(String name, AttributeList attributes)
           
 void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
          Display unparsed entity declarations as they are reported.
 void warning(SAXParseException exception)
          Report all warnings, and continue parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nilValue

private Object nilValue

answer

private IeObject answer

attributeValue

private Object attributeValue

foundErrorLevel

private int foundErrorLevel

lastTag

private String lastTag

returnData

private StringBuffer returnData

contentTypeStack

private Stack contentTypeStack

javaTypeStack

private Stack javaTypeStack

timeZoneStack

private Stack timeZoneStack

objectStack

private Stack objectStack

typeStack

private Stack typeStack

valueStack

private Stack valueStack

stateStack

private Stack stateStack

DEBUG

public static boolean DEBUG

NODE

private static final int NODE
See Also:
Constant Field Values

META

private static final int META
See Also:
Constant Field Values

ATTR

private static final int ATTR
See Also:
Constant Field Values

DATUM

private static final int DATUM
See Also:
Constant Field Values

NA

private static final int NA
See Also:
Constant Field Values

ATT_TAG

public static final String ATT_TAG
Print a message for the start of an element.

Display all attributes on separate lines, indented.

See Also:
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList), Constant Field Values

COLLECTION_TAG

public static final String COLLECTION_TAG
See Also:
Constant Field Values

GROUP_TAG

public static final String GROUP_TAG
See Also:
Constant Field Values

INSTANCE_TAG

public static final String INSTANCE_TAG
See Also:
Constant Field Values

META_TAG

public static final String META_TAG
See Also:
Constant Field Values

MESSAGE_TAG

public static final String MESSAGE_TAG
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

OBJECT_TYPE

public static final String OBJECT_TYPE
See Also:
Constant Field Values
Constructor Detail

IeSaxHandler

public IeSaxHandler()
Method Detail

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
Display notation declarations as they are reported.

Specified by:
notationDecl in interface DTDHandler
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               String publicId,
                               String systemId,
                               String notationName)
Display unparsed entity declarations as they are reported.

Specified by:
unparsedEntityDecl in interface DTDHandler
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

getOutput

public IeObject getOutput()
Specified by:
getOutput in interface I_readIeObjectXML

getErrorLevel

public int getErrorLevel()
Specified by:
getErrorLevel in interface I_readIeObjectXML

getErrorMessage

public String getErrorMessage()

setDocumentLocator

public void setDocumentLocator(Locator locator)
Print a message when the parser provides a locator.

Not all SAX parsers will provide a locator object.

Specified by:
setDocumentLocator in interface DocumentHandler
See Also:
DocumentHandler.setDocumentLocator(org.xml.sax.Locator)

startDocument

public void startDocument()
Initialize stack.

Specified by:
startDocument in interface DocumentHandler
See Also:
DocumentHandler.startDocument()

endDocument

public void endDocument()
Print a message for the end of the document.

Specified by:
endDocument in interface DocumentHandler
See Also:
DocumentHandler.endDocument()

getIeObject

public IeObject getIeObject()

startElement

public void startElement(String name,
                         AttributeList attributes)
Specified by:
startElement in interface DocumentHandler

endElement

public void endElement(String name)
Print a message for the end of an element.

Specified by:
endElement in interface DocumentHandler
See Also:
DocumentHandler.endElement(java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
Print a message for character data.

Specified by:
characters in interface DocumentHandler
See Also:
DocumentHandler.characters(char[], int, int)

getElement

private String getElement(String name,
                          AttributeList atlist)
Fish through the passed AttributeList to find a specified attribute by name.


ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Print a message for ignorable whitespace.

Specified by:
ignorableWhitespace in interface DocumentHandler
See Also:
DocumentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(String target,
                                  String data)
Print a message for a processing instruction.

Specified by:
processingInstruction in interface DocumentHandler
See Also:
DocumentHandler.processingInstruction(java.lang.String, java.lang.String)

warning

public void warning(SAXParseException exception)
Report all warnings, and continue parsing.

Specified by:
warning in interface ErrorHandler
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)

error

public void error(SAXParseException exception)
Report all recoverable errors, and try to continue parsing.

Specified by:
error in interface ErrorHandler
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(SAXParseException exception)
Report all fatal errors, and try to continue parsing.

Note: results are no longer reliable once a fatal error has been reported.

Specified by:
fatalError in interface ErrorHandler
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

display

private static void display(String prefix,
                            char[] ch,
                            int start,
                            int length)
Display text, escaping some characters.


hexToByte

public static byte[] hexToByte(String s)