public class XMLConfiguration extends java.lang.Object implements ArooaConfiguration
ArooaConfiguration that wraps some XML data and
allows it to be parsed.| Modifier and Type | Class and Description |
|---|---|
static interface |
XMLConfiguration.SaveHandler |
| Constructor and Description |
|---|
XMLConfiguration(java.io.File file)
Constructor for a file.
|
XMLConfiguration(java.lang.String resource,
java.lang.ClassLoader maybeClassLoader)
Constructor for a ClassLoader resource.
|
XMLConfiguration(java.lang.String systemId,
java.io.InputStream in)
Constructor for an InputStream.
|
XMLConfiguration(java.lang.String systemId,
java.lang.String xml)
Constructor for Text.
|
XMLConfiguration(java.net.URL url)
Constructor for a URL.
|
| Modifier and Type | Method and Description |
|---|---|
XMLConfiguration.SaveHandler |
getSaveHandler() |
<P extends ParseContext<P>> |
parse(P parentContext)
Parse the encapsulated configuration.
|
void |
setSaveHandler(XMLConfiguration.SaveHandler saveHandler)
Get the resultant XML from calling
ConfigurationHandle.save(). |
java.lang.String |
toString() |
public XMLConfiguration(java.io.File file)
file - public XMLConfiguration(java.lang.String systemId,
java.lang.String xml)
systemId - xml - public XMLConfiguration(java.lang.String resource,
java.lang.ClassLoader maybeClassLoader)
E.g. new XMLConfiguration("org/oddjob/stuff/config.xml");
resource - public XMLConfiguration(java.lang.String systemId,
java.io.InputStream in)
systemId - in - public XMLConfiguration(java.net.URL url)
url - public <P extends ParseContext<P>> ConfigurationHandle<P> parse(P parentContext) throws ArooaParseException
ArooaConfigurationparse in interface ArooaConfigurationP - The type of the context in which parsing occurs.parentContext - The context in which this configuration will be
parsed. This context will provide the
ArooaHandler, and therefore
subsequent child contexts.ConfigurationHandle. The handle provides access to the context created
as the result of the parse and a way of saving this context back into the configuration.ArooaParseException - If parsing fails.public void setSaveHandler(XMLConfiguration.SaveHandler saveHandler)
ConfigurationHandle.save().public XMLConfiguration.SaveHandler getSaveHandler()
public java.lang.String toString()
toString in class java.lang.Object