|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alien.enterpriseRFID.util.XMLReader
This is a simple XML reader that reads supplied XML text and parses its contents into a HashTable. It will only read one level of tags deep, and performs all reads in memory, so XML file size is somewhat limited. Results are returned as a Hashtable of tag-value pairs.
Given the following XML:
The result will be a 2-entry hashtable of:Hello Wow
TAG = Hello One = Wow
Call this class repeatedly to dive down into multi-layer trees. To read:
Call the class once, to return a Hashtable of:Chris today
TAG = "and then call the class again on the results to resolve individual entries.Chris today "
Constructor Summary | |
XMLReader(java.lang.String string)
Construct a new XMLReader to read and parse XML data from a String. |
Method Summary | |
java.lang.String |
getXMLString()
Returns the XML string data being parsed. |
java.util.Hashtable |
readXML()
Scans the entire XML string, parsing its elements into a Hashtable. |
java.util.Hashtable |
readXML(java.util.Hashtable hashtable)
Read entire XML into a given Hashtable. |
boolean |
readXMLNode(java.util.Hashtable hashtable)
Reads and parses a single XML node into a Hashtable. |
void |
setXMLString(java.lang.String XMLString)
Sets the XML string to be parsed. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLReader(java.lang.String string)
string
- the string to read XML data fromMethod Detail |
public java.lang.String getXMLString()
public void setXMLString(java.lang.String XMLString)
XMLString
- the XML data to parsepublic java.util.Hashtable readXML() throws java.text.ParseException
java.text.ParseException
- if XML is invalidpublic java.util.Hashtable readXML(java.util.Hashtable hashtable) throws java.text.ParseException
hashtable
- a Hasttable to read the data into
java.text.ParseException
- is XML is invalidpublic boolean readXMLNode(java.util.Hashtable hashtable) throws java.text.ParseException
hashtable
- the Hashtable to read the single node into
true
if there are more nodes to read, false
otherwise
java.text.ParseException
- if XML is invalid or the hashtable is null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |