|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
nl.tue.win.riaca.openmath.io.OMXMLReader
Constructs an OpenMath Object (OMObject) from the XML-input.
Field Summary | |
protected int |
foreign
Stores if we are inside a foreign object section. |
protected boolean |
keep
Stores if we should keep the outer OMOBJ. |
protected java.util.Vector |
mElementStack
Stores an vector with the last active element as the last in the vector. |
protected org.xml.sax.InputSource |
mInputSource
Stores the input-source. |
protected OMObject |
mOMObject
Stores the OMObject for this reader. |
protected static java.lang.String[] |
sOMObjects
Stores a static array with all the OpenMath element-names in use. |
Constructor Summary | |
OMXMLReader()
Constructor. |
|
OMXMLReader(org.xml.sax.InputSource fInputSource)
Constructor. |
|
OMXMLReader(java.lang.String fString)
Constructor taking a String as the InputSource. |
|
OMXMLReader(java.lang.String newString,
boolean newKeep)
Constructor taking a String as the InputSource and a boolean indicating if we want to keep the outer OMOBJ. |
Method Summary | |
void |
characters(char[] fCharacters,
int fStart,
int fLength)
We've encountered a PCDATA section. |
void |
endDocument()
End the document. |
void |
endElement(java.lang.String fNamespaceURI,
java.lang.String fLocalName,
java.lang.String fRawName)
End a XML element. |
OMObject |
getObject()
Get the OpenMath object. |
void |
ignorableWhitespace(char[] tCharacter,
int tStart,
int tLength)
Process ignorable whitespace. |
void |
processingInstruction(java.lang.String fTarget,
java.lang.String fData)
Process the processing instruction. |
OMObject |
readObject()
Read an OpenMath object. |
void |
setDocumentLocator(org.xml.sax.Locator fLocator)
Set the document-locator. |
void |
startDocument()
Signals the start of the document. |
void |
startElement(java.lang.String fNamespaceURI,
java.lang.String fLocalName,
java.lang.String fRawName,
org.xml.sax.Attributes fAttributes)
Start a XML element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, error, fatalError, notationDecl, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.String[] sOMObjects
protected OMObject mOMObject
protected java.util.Vector mElementStack
protected org.xml.sax.InputSource mInputSource
protected boolean keep
protected int foreign
Note: if we find another foreign inside the foreign we add to this number to make sure we can handle the endElements correctly.
Constructor Detail |
public OMXMLReader()
public OMXMLReader(org.xml.sax.InputSource fInputSource)
fInputSource
- the InputSource to read from.public OMXMLReader(java.lang.String fString)
fString
- the string to read from.public OMXMLReader(java.lang.String newString, boolean newKeep)
newString
- the input sourcenewKeep
- the boolean indicating if we keep the OMOBJMethod Detail |
public void characters(char[] fCharacters, int fStart, int fLength) throws org.xml.sax.SAXException
Check if we have an enclosing OMInteger or OMString and set the data-members accordingly.
fCharacters
- the characters to handle.fStart
- the start index into the characters array.fLength
- the number of characters to read from the start.
org.xml.sax.SAXException
- when something is seriously wrong.public void endDocument()
public void endElement(java.lang.String fNamespaceURI, java.lang.String fLocalName, java.lang.String fRawName) throws org.xml.sax.SAXException
fNamespaceURI
- the URI of the namespace.fLocalName
- the locale name of the element.fRawName
- the raw name of the element.
org.xml.sax.SAXException
- when something is seriously wrong.public void ignorableWhitespace(char[] tCharacter, int tStart, int tLength)
tCharacter
- the characters that can be ignored.tStart
- the start index into the characters array.tLength
- the number of characters to ignore.public void processingInstruction(java.lang.String fTarget, java.lang.String fData)
fTarget
- the target of the processing instruction.fData
- the data of the processing instruction.public OMObject readObject() throws java.io.IOException
java.io.IOException
- when reading failed.public OMObject getObject()
Note: if you didn't set this reader up from an input-source nor from a String, you will need this method to get the actual object at the end of reading. This method will only garantuee the proper result if you call it after 'endDocument' has be recognized.
public void setDocumentLocator(org.xml.sax.Locator fLocator)
fLocator
- the document locator to use.public void startDocument()
We reinitiliaze all the data-structures used during parsing, note that this parser is not reentrant and should only be used sequentially.
public void startElement(java.lang.String fNamespaceURI, java.lang.String fLocalName, java.lang.String fRawName, org.xml.sax.Attributes fAttributes) throws org.xml.sax.SAXException
fNamespaceURI
- the namespace URI.fLocalName
- the local name of the element.fRawName
- the raw name of the element.fAttributes
- the attributes of the element.
org.xml.sax.SAXException
- when something is seriously wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |