public abstract class XMLBuilder extends Object
The class creates a XML document
. Following jbotsim-
DEFAULT_VERSION
.xsd
schema, a root element labelled "jbotsim"
is added to the document and its attribute version
is
assigned the value DEFAULT_VERSION
.
Helper methods exists to output the document using methods of the XMLIO
class.
XMLIO
,
XMLIO.XMLIOException
Modifier and Type | Class and Description |
---|---|
static class |
XMLBuilder.BuilderException
Exception raised whenever an error occurs while a
Document is built. |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_VERSION
Default version of the XSD schema used to parse JBotsim XML documents.
|
Modifier | Constructor and Description |
---|---|
protected |
XMLBuilder() |
Modifier and Type | Method and Description |
---|---|
Document |
getDocument()
Accessor to the
Document handled by this builder. |
String |
writeToString()
Outputs the current XML document into the specified file pointed by the given
File descriptor. |
public static final String DEFAULT_VERSION
protected XMLBuilder() throws XMLBuilder.BuilderException
XMLBuilder.BuilderException
public Document getDocument()
Document
handled by this builder.Document
under constructionpublic String writeToString() throws XMLBuilder.BuilderException
File
descriptor.Document
converted into a String
.XMLBuilder.BuilderException
- raised either when an XML error occurs while the document is created or if an IO error
occurs.