org.jbind.xml.facade
Class ConfigurationCode

java.lang.Object
  extended byorg.jbind.xml.facade.XmlCode
      extended byorg.jbind.xml.facade.ConfigurationCode
All Implemented Interfaces:
IConfigurationCode, IXmlCode
Direct Known Subclasses:
ApplicationCode

public class ConfigurationCode
extends XmlCode
implements IConfigurationCode


Nested Class Summary
protected static class ConfigurationCode.SetupVisitor
          Sets up children before there ancestors.
protected static class ConfigurationCode.TearDownVisitor
          Tears down ancestors before their children.
 
Constructor Summary
ConfigurationCode(org.xml.sax.InputSource anInputSource, IDataContext aDataContext)
           
ConfigurationCode(java.net.URL aUrl, IDataContext aDataContext)
          Creates a configurer.
 
Method Summary
 IConfiguration getConfiguration()
           
 void setup()
          Sets up the configuration by visiting all nodes in the XML configuration data.
 void tearDown()
          Tears down the configuration by visiting all node in the XML configuration data.
 
Methods inherited from class org.jbind.xml.facade.XmlCode
getCode, getUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.code.IXmlCode
getCode, getUrl
 

Constructor Detail

ConfigurationCode

public ConfigurationCode(java.net.URL aUrl,
                         IDataContext aDataContext)
Creates a configurer.

Parameters:
aUrl - (required).
aDataContext - (optional).

ConfigurationCode

public ConfigurationCode(org.xml.sax.InputSource anInputSource,
                         IDataContext aDataContext)
Method Detail

getConfiguration

public IConfiguration getConfiguration()
                                throws XmlException
Specified by:
getConfiguration in interface IConfigurationCode
Throws:
XmlException

setup

public void setup()
           throws XmlException
Description copied from interface: IConfigurationCode
Sets up the configuration by visiting all nodes in the XML configuration data. If a node implements the ISetupAndTearDown interface then its setup method is called during a visit. Descendant nodes are setup before their ancestors.

The getNbSetupAndTearDownLevels method of the XML configuration data determines how often the data is visited. The visit is iterated starting at level 0.

Specified by:
setup in interface IConfigurationCode
Throws:
XmlException

tearDown

public void tearDown()
              throws XmlException
Description copied from interface: IConfigurationCode
Tears down the configuration by visiting all node in the XML configuration data. If a node implements the ISetupAndTearDown interface then its setup tear down method is called. Ancestor nodes are teared down before their descendants.

The getNbSetupAndTearDownLevels method of the XML configuration data determines how often the data is visited. The visit is iterated starting at the number of levels - 1.

Specified by:
tearDown in interface IConfigurationCode
Throws:
XmlException