|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.util.XMLVisitor
An extremely custom kind of Visitor that knows how to traverse the top-level elements of an XML file. Used by the various "registries" in the game.
Nested Class Summary | |
static interface |
XMLVisitor.NodeVisitor
You provide one of these to the visitNodes() method, and it'll call your Visitor back with each top-level node in the XML document. |
Constructor Summary | |
XMLVisitor(java.lang.String path)
Constructs a new XMLVisitor for the specified XML file. |
Method Summary | |
org.jdom.Document |
getDocument()
Returns the Document we built (during the constructor). |
static void |
main(java.lang.String[] args)
Tests it on the spell registry. |
void |
visitNodes(XMLVisitor.NodeVisitor v)
Passes each top-level XML node to the passed Visitor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLVisitor(java.lang.String path) throws java.io.IOException, org.jdom.JDOMException
path
- the absolute path to the file to load.Method Detail |
public void visitNodes(XMLVisitor.NodeVisitor v)
v
- a NodeVisitor to accept the nodespublic org.jdom.Document getDocument()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |