org.oddjob.arooa.xml
Class XMLConfiguration

java.lang.Object
  extended by org.oddjob.arooa.xml.XMLConfiguration
All Implemented Interfaces:
ArooaConfiguration

public class XMLConfiguration
extends Object
implements ArooaConfiguration

An ArooaConfiguration that wraps some XML data and allows it to be parsed.

Author:
rob

Nested Class Summary
static interface XMLConfiguration.SaveHandler
           
 
Constructor Summary
XMLConfiguration(File file)
          Constructor for a file.
XMLConfiguration(String resource, ClassLoader maybeClassLoader)
          Constructor for a ClassLoader resource.
XMLConfiguration(String systemId, InputStream in)
          Constructor for an InputStream.
XMLConfiguration(String systemId, String xml)
          Constructor for Text.
XMLConfiguration(URL url)
          Constructor for a URL.
 
Method Summary
 XMLConfiguration.SaveHandler getSaveHandler()
           
 ConfigurationHandle parse(ArooaContext parentContext)
          Parse the encapsulated configuration.
 void setSaveHandler(XMLConfiguration.SaveHandler saveHandler)
          Get the resultant XML from calling ConfigurationHandle.save().
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLConfiguration

public XMLConfiguration(File file)
Constructor for a file.

Parameters:
file -

XMLConfiguration

public XMLConfiguration(String systemId,
                        String xml)
Constructor for Text.

Parameters:
systemId -
xml -

XMLConfiguration

public XMLConfiguration(String resource,
                        ClassLoader maybeClassLoader)
Constructor for a ClassLoader resource. Note that, like the underlying ClassLoader.getResourceAsStream, the resource does not have a '/' before the package name.

E.g. new XMLConfiguration("org/oddjob/stuff/config.xml");

Parameters:
resource -

XMLConfiguration

public XMLConfiguration(String systemId,
                        InputStream in)
Constructor for an InputStream.

Parameters:
systemId -
in -

XMLConfiguration

public XMLConfiguration(URL url)
Constructor for a URL.

Parameters:
url -
Method Detail

parse

public ConfigurationHandle parse(ArooaContext parentContext)
                          throws ArooaParseException
Description copied from interface: ArooaConfiguration
Parse the encapsulated configuration.

Specified by:
parse in interface ArooaConfiguration
Parameters:
parentContext - The parent context to use.
Returns:
A ConfigurationHandle.
Throws:
ArooaParseException

setSaveHandler

public void setSaveHandler(XMLConfiguration.SaveHandler saveHandler)
Get the resultant XML from calling ConfigurationHandle.save().


getSaveHandler

public XMLConfiguration.SaveHandler getSaveHandler()

toString

public String toString()
Overrides:
toString in class Object