public class XMLOptions extends java.lang.Object implements RevisionHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATT_NAME
the name attribute.
|
static java.lang.String |
ATT_TYPE
the type attribute.
|
static java.lang.String |
ATT_VALUE
the value attribute.
|
static java.lang.String |
DOCTYPE
the DTD for the XML file.
|
static java.lang.String |
ROOT_NODE
the root node.
|
static java.lang.String |
TAG_OPTION
tag for a single option.
|
static java.lang.String |
TAG_OPTIONS
tag for a list of options.
|
static java.lang.String |
VAL_TYPE_CLASSIFIER
a value of the type attribute.
|
static java.lang.String |
VAL_TYPE_FLAG
a value of the type attribute.
|
static java.lang.String |
VAL_TYPE_HYPHENS
a value of the type attribute.
|
static java.lang.String |
VAL_TYPE_OPTIONHANDLER
a value of the type attribute.
|
static java.lang.String |
VAL_TYPE_QUOTES
a value of the type attribute.
|
static java.lang.String |
VAL_TYPE_SINGLE
a value of the type attribute.
|
| Constructor and Description |
|---|
XMLOptions()
Creates a new instance of XMLOptions.
|
XMLOptions(java.io.File file)
Creates a new instance of XMLOptions.
|
XMLOptions(java.io.InputStream stream)
Creates a new instance of XMLOptions.
|
XMLOptions(java.io.Reader reader)
Creates a new instance of XMLOptions.
|
XMLOptions(java.lang.String xml)
Creates a new instance of XMLOptions.
|
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Document |
getDocument()
returns the parsed DOM document.
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
getValidating()
returns whether a validating parser is used.
|
XMLDocument |
getXMLDocument()
returns the handler of the XML document.
|
static void |
main(java.lang.String[] args)
for testing only.
|
void |
setValidating(boolean validating)
sets whether to use a validating parser or not.
|
java.lang.String[] |
toArray()
returns the current DOM document as string array.
|
java.lang.String |
toCommandLine()
returns the given DOM document as command line.
|
java.lang.String |
toString()
returns the object in a string representation (as indented XML output).
|
public static final java.lang.String TAG_OPTION
public static final java.lang.String TAG_OPTIONS
public static final java.lang.String ATT_NAME
public static final java.lang.String ATT_TYPE
public static final java.lang.String ATT_VALUE
public static final java.lang.String VAL_TYPE_FLAG
public static final java.lang.String VAL_TYPE_SINGLE
public static final java.lang.String VAL_TYPE_HYPHENS
public static final java.lang.String VAL_TYPE_QUOTES
public static final java.lang.String VAL_TYPE_CLASSIFIER
public static final java.lang.String VAL_TYPE_OPTIONHANDLER
public static final java.lang.String ROOT_NODE
public static final java.lang.String DOCTYPE
public XMLOptions()
throws java.lang.Exception
java.lang.Exception - if the construction of the DocumentBuilder failssetValidating(boolean)public XMLOptions(java.lang.String xml)
throws java.lang.Exception
xml - the xml to parse (if "
java.lang.Exception - if the construction of the DocumentBuilder failssetValidating(boolean)public XMLOptions(java.io.File file)
throws java.lang.Exception
file - the XML file to parsejava.lang.Exception - if the construction of the DocumentBuilder failssetValidating(boolean)public XMLOptions(java.io.InputStream stream)
throws java.lang.Exception
stream - the XML stream to parsejava.lang.Exception - if the construction of the DocumentBuilder failssetValidating(boolean)public XMLOptions(java.io.Reader reader)
throws java.lang.Exception
reader - the XML reader to parsejava.lang.Exception - if the construction of the DocumentBuilder failssetValidating(boolean)public boolean getValidating()
public void setValidating(boolean validating)
throws java.lang.Exception
validating - whether to use a validating parserjava.lang.Exception - if the instantiating of the DocumentBuilder failspublic org.w3c.dom.Document getDocument()
public XMLDocument getXMLDocument()
getDocument() method.getDocument()public java.lang.String toCommandLine()
throws java.lang.Exception
java.lang.Exception - if anything goes wrong initializing the parsingpublic java.lang.String[] toArray()
throws java.lang.Exception
java.lang.Exception - if anything goes wrong initializing the parsingpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void main(java.lang.String[] args)
throws java.lang.Exception
args - the commandline options.java.lang.Exception - if something goes wrong