|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectglassfrog.tools.XMLParser
public class XMLParser
| Field Summary | |
|---|---|
private javax.xml.parsers.DocumentBuilder |
builder
|
private org.w3c.dom.Document |
doc
|
| Constructor Summary | |
|---|---|
XMLParser(java.lang.String file)
Set up the XMLParser for the specified file |
|
| Method Summary | |
|---|---|
int[] |
getArrayFromNode(org.w3c.dom.Node node,
java.lang.String tag)
Used to get the value of the content at a given node and return it as a array of ints. |
boolean |
getBooleanFromNode(org.w3c.dom.Node node,
java.lang.String tag)
Used to get the value of the content at a given node and return it as a boolean |
int |
getIntFromNode(org.w3c.dom.Node node,
java.lang.String tag)
Used to get the value of the content at a given node and return it as a int |
java.lang.String |
getStringFromNode(org.w3c.dom.Node node,
java.lang.String tag)
Used to get the value of the content at a given node and return it as a String |
org.w3c.dom.NodeList |
parseElements(java.lang.String tag)
Used to parse out the elements in the XML matching the specified tag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private javax.xml.parsers.DocumentBuilder builder
private org.w3c.dom.Document doc
| Constructor Detail |
|---|
public XMLParser(java.lang.String file)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXParseException,
org.xml.sax.SAXException,
java.io.IOException
file - A string for the file to be parsed. Must be the full path
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXParseException
java.io.IOException
org.xml.sax.SAXException| Method Detail |
|---|
public org.w3c.dom.NodeList parseElements(java.lang.String tag)
tag - The tag representing the tag of the element to parse out
public java.lang.String getStringFromNode(org.w3c.dom.Node node,
java.lang.String tag)
node - A Node in the XMLDocumenttag - A tag representing the tag of the element to extract the value
public int getIntFromNode(org.w3c.dom.Node node,
java.lang.String tag)
node - A Node in the XMLDocumenttag - A tag representing the tag of the element to extract the value
public int[] getArrayFromNode(org.w3c.dom.Node node,
java.lang.String tag)
node - A Node in the XMLDocumenttag - A tag representing the tag of the element to extract the value
public boolean getBooleanFromNode(org.w3c.dom.Node node,
java.lang.String tag)
node - A Node in the XMLDocumenttag - A tag representing the tag of the element to extract the value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||