|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.TaskHeap.util.XMLStandardReader
public class XMLStandardReader
A utility to read a SandMessage from XML using a SAX parser. This is
higher overhead but more forgiving than what the XMLSerializer does.
Reads a single SandMesssage, which may be a SandCollectionMessage.
AUTOGENERATED FILE, DO NOT EDIT DIRECTLY.
source: declared in build
generator: org.sandev.generator.XMLStandardReaderGenerator
time: Jul 31, 2008 4:34:17 PM
| Field Summary | |
|---|---|
protected java.util.ArrayList |
context
A stack of context entries. |
protected java.lang.String |
currElem
The qualified name of the current element we are reading while parsing the XML. |
protected org.xml.sax.Locator |
documentLocator
During a callback method implementation, the locator can be used to report where you are in the XML file. |
| Constructor Summary | |
|---|---|
XMLStandardReader()
|
|
| Method Summary | |
|---|---|
protected void |
addMessageToParentInContext(org.sandev.basics.structs.SandMessage child)
Add the given message to the appropriate contained field in the parent message, which is the last entry in the context stack. |
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
void |
endDocument()
Receive notification of the end of a document. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
Receive notification of the end of an element |
void |
endPrefixMapping(java.lang.String prefix)
Hook for notifying close of prefix mapping. |
protected org.sandev.TaskHeap.util.XMLStandardReader.SMContext |
getCurrContext()
Return the current SMContext we are working with. |
org.xml.sax.Locator |
getDocumentLocator()
accessor for documentLocator |
protected java.lang.String |
getFullClassName(java.lang.String name)
Given the short name of a SandMessage, return the fully qualified class name. |
org.sandev.basics.structs.SandMessage |
getMessageFromXML(java.lang.String xml)
Returns the SandMessage read from the given XML. |
protected org.sandev.basics.structs.SandMessage |
getSandMessageForName(java.lang.String name)
Given the fully qualified name of a SandMessage, return an instance of that message or throw. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
protected static void |
info(java.lang.String text)
For messages outside of normal operation that are helpful to log. |
protected org.sandev.basics.structs.SandMessage |
popMessageContext()
Pop the last SMContext off the stack and return its SandMessage. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Receive notification of a processing instruction. |
protected void |
pushMessageContext(org.sandev.basics.structs.SandMessage sm,
int index)
Create a new SMContext instance and push it onto our context stack. |
protected static void |
readTrace(java.lang.String text)
Body of method can be uncommented to produce a trace of the message read processing |
void |
setDocumentLocator(org.xml.sax.Locator loc)
mutator for documentLocator |
protected void |
setFieldValuesFromAttributes(org.sandev.basics.structs.SandMessage sm,
org.xml.sax.Attributes atts)
Read the attributes and set the field values in the given message accordingly. |
void |
skippedEntity(java.lang.String name)
Receive notification of a skipped entity. |
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
Receive notification of the beginning of an element |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Hook for handling prefix URIs for Namespace expansion. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String currElem
protected java.util.ArrayList context
protected org.xml.sax.Locator documentLocator
| Constructor Detail |
|---|
public XMLStandardReader()
| Method Detail |
|---|
public org.sandev.basics.structs.SandMessage getMessageFromXML(java.lang.String xml)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandExceptionpublic org.xml.sax.Locator getDocumentLocator()
public void setDocumentLocator(org.xml.sax.Locator loc)
setDocumentLocator in interface org.xml.sax.ContentHandler
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionpublic void endDocument()
endDocument in interface org.xml.sax.ContentHandler
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException
endPrefixMapping in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
ignorableWhitespace in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException
skippedEntity in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionprotected static void readTrace(java.lang.String text)
protected static void info(java.lang.String text)
protected org.sandev.basics.structs.SandMessage getSandMessageForName(java.lang.String name)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected java.lang.String getFullClassName(java.lang.String name)
protected void setFieldValuesFromAttributes(org.sandev.basics.structs.SandMessage sm,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void pushMessageContext(org.sandev.basics.structs.SandMessage sm,
int index)
protected org.sandev.basics.structs.SandMessage popMessageContext()
protected org.sandev.TaskHeap.util.XMLStandardReader.SMContext getCurrContext()
protected void addMessageToParentInContext(org.sandev.basics.structs.SandMessage child)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||