|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.util.XMLFileParser
public class XMLFileParser
Creates a Document directly from an XML file. Elements within the XML file are represented by nodes in a tree data structure. All elements in the XML document will be loaded into working memory so consider file size when using this parser. Generally, this will be the XML parser used by VOOGA. Can be initialized without a file, but then the file must be set before attempting to parse anything. Generally it is safer to initialize with a file. Example code for parsing a Document using a file path:
XMLDocumentCreator xmlCreator = new XMLFileParser(defaultPath + resourcesXMLFilepath); Document doc = xmlCreator.getDocument();
Constructor Summary | |
---|---|
XMLFileParser()
Create without reference to a file. |
|
XMLFileParser(java.io.File xmlFile)
Create with a reference to a file to be parsed |
|
XMLFileParser(java.lang.String xmlFileLocation)
Create with a reference to a file to be parsed |
Method Summary | |
---|---|
org.w3c.dom.Document |
getDocument()
Produce a Document from some XML source |
void |
setParseFile(java.io.File xmlFile)
Set reference to file to be parsed |
void |
setParseFile(java.lang.String xmlFileLocation)
Set reference to file to be parsed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLFileParser()
public XMLFileParser(java.lang.String xmlFileLocation)
xmlFileLocation
- String representing the file path to XML file to be parsedpublic XMLFileParser(java.io.File xmlFile)
xmlFile
- XML file to be parsedMethod Detail |
---|
public void setParseFile(java.lang.String xmlFileLocation)
xmlFileLocation
- String representing the file path to XML file to be parsedpublic void setParseFile(java.io.File xmlFile)
xmlFileLocation
- XML file to be parsedpublic org.w3c.dom.Document getDocument() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
XMLDocumentCreator
getDocument
in interface XMLDocumentCreator
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |