VASSAL.build
Class Builder
java.lang.Object
|
+--VASSAL.build.Builder
- public abstract class Builder
- extends java.lang.Object
This class holds static convenience methods for building Buildable
objects
|
Method Summary |
static void |
build(org.w3c.dom.Element e,
Buildable parent)
General building algorithm. |
static Buildable |
create(org.w3c.dom.Element e)
Create an instance of a class from an XML element and build it
The .class file for the named class may be either
in the System's classpath or else within the DataArchive
of the GameModule |
static org.w3c.dom.Document |
createDocument(java.io.InputStream inStream)
Read an XML document from an InputStream |
static org.w3c.dom.Document |
createNewDocument()
Create a new XML document |
static java.lang.String |
getText(org.w3c.dom.Element e)
Return the decoded text contents of an Element node |
static void |
main(java.lang.String[] args)
|
static java.lang.String |
toString(org.w3c.dom.Node n)
|
static void |
writeDocument(org.w3c.dom.Document doc,
java.io.OutputStream out)
Write an XML document to an OutputStream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Builder
public Builder()
build
public static void build(org.w3c.dom.Element e,
Buildable parent)
- General building algorithm. For each subelement of the build
Element, this method creates an instance of the class (which
must implement Buildable) whose name matches the XML element
tag name, builds that instance with the subelement, and adds it
to the parent Buildable
This algorithm calls a component's
Buildable.build(org.w3c.dom.Element) method
before calling its Buildable.addTo(VASSAL.build.Buildable) method
- Parameters:
parent - the parent Buildable instance
create
public static Buildable create(org.w3c.dom.Element e)
throws java.lang.Exception
- Create an instance of a class from an XML element and build it
The
.class file for the named class may be either
in the System's classpath or else within the DataArchive
of the GameModule
createDocument
public static org.w3c.dom.Document createDocument(java.io.InputStream inStream)
throws java.io.IOException
- Read an XML document from an InputStream
createNewDocument
public static org.w3c.dom.Document createNewDocument()
- Create a new XML document
writeDocument
public static void writeDocument(org.w3c.dom.Document doc,
java.io.OutputStream out)
- Write an XML document to an OutputStream
getText
public static java.lang.String getText(org.w3c.dom.Element e)
- Return the decoded text contents of an Element node
toString
public static java.lang.String toString(org.w3c.dom.Node n)
- Returns:
- a String representation of an XML Node
main
public static void main(java.lang.String[] args)