com.opensymphony.xwork.mock
Class MockConfiguration

java.lang.Object
  extended by com.opensymphony.xwork.mock.MockConfiguration
All Implemented Interfaces:
Configuration

public class MockConfiguration
extends Object
implements Configuration

Mock for an Configuration.

Version:
$Date: 2007-11-25 08:06:04 -0600 (Sun, 25 Nov 2007) $ $Id: MockConfiguration.java 1682 2007-11-25 14:06:04Z tm_jee $
Author:
Mike, tmjee

Constructor Summary
MockConfiguration()
           
 
Method Summary
 void addPackageConfig(String name, PackageConfig packageContext)
          Add a PackageConfig with package name specified as name
 void buildRuntimeConfiguration()
           
 void destroy()
          Allow the Configuration to clean up any resources that have been used.
 PackageConfig getPackageConfig(String name)
          Return the PackageConfig (package configuration) for package with named as name
 Set getPackageConfigNames()
          Return the PackageConfigs name as a Set.
 Map getPackageConfigs()
          Return the PackageConfig as a Map with the key as the package name and its value as the corresponding PackageConfig
 String getParameter(String name)
          Return the configuration parameter value for with parameter name as name.
 Map getParameters()
          Return the configuration parameters in xwork.xml
 RuntimeConfiguration getRuntimeConfiguration()
          The current runtime configuration.
 void rebuildRuntimeConfiguration()
          Rebuild the RuntimeConfiguration of XWork's configuration.
 void reload()
          Reload xwork configuration, once this is done, we need to grab the RuntimeConfiguration using Configuration.getRuntimeConfiguration()
 void removePackageConfig(String name)
          Remove the PackageConfig for package with name as name.
 void setParameter(String name, String value)
          Set the configuration parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockConfiguration

public MockConfiguration()
Method Detail

getParameters

public Map getParameters()
Description copied from interface: Configuration
Return the configuration parameters in xwork.xml
    
      
         
         ....
      
      ....
    
 

Specified by:
getParameters in interface Configuration
Returns:
Map

getParameter

public String getParameter(String name)
Description copied from interface: Configuration
Return the configuration parameter value for with parameter name as name.

Specified by:
getParameter in interface Configuration
Parameters:
name - parameter name
Returns:
String

setParameter

public void setParameter(String name,
                         String value)
Description copied from interface: Configuration
Set the configuration parameter.

Specified by:
setParameter in interface Configuration
Parameters:
name - parameter name
value - parameter value

getPackageConfig

public PackageConfig getPackageConfig(String name)
Description copied from interface: Configuration
Return the PackageConfig (package configuration) for package with named as name

Specified by:
getPackageConfig in interface Configuration
Parameters:
name - package name
Returns:
PackageConfig

getPackageConfigNames

public Set getPackageConfigNames()
Description copied from interface: Configuration
Return the PackageConfigs name as a Set.

Specified by:
getPackageConfigNames in interface Configuration
Returns:
Set

getPackageConfigs

public Map getPackageConfigs()
Description copied from interface: Configuration
Return the PackageConfig as a Map with the key as the package name and its value as the corresponding PackageConfig

Specified by:
getPackageConfigs in interface Configuration
Returns:
Map

getRuntimeConfiguration

public RuntimeConfiguration getRuntimeConfiguration()
Description copied from interface: Configuration
The current runtime configuration. Currently, if changes have been made to the Configuration since the last time buildRuntimeConfiguration() was called, you'll need to make sure to get it using this method.

Specified by:
getRuntimeConfiguration in interface Configuration
Returns:
the current runtime configuration

addPackageConfig

public void addPackageConfig(String name,
                             PackageConfig packageContext)
Description copied from interface: Configuration
Add a PackageConfig with package name specified as name

Specified by:
addPackageConfig in interface Configuration

buildRuntimeConfiguration

public void buildRuntimeConfiguration()

destroy

public void destroy()
Description copied from interface: Configuration
Allow the Configuration to clean up any resources that have been used.

Specified by:
destroy in interface Configuration

rebuildRuntimeConfiguration

public void rebuildRuntimeConfiguration()
Description copied from interface: Configuration
Rebuild the RuntimeConfiguration of XWork's configuration.

Specified by:
rebuildRuntimeConfiguration in interface Configuration

reload

public void reload()
            throws ConfigurationException
Description copied from interface: Configuration
Reload xwork configuration, once this is done, we need to grab the RuntimeConfiguration using Configuration.getRuntimeConfiguration()

Specified by:
reload in interface Configuration
Throws:
ConfigurationException

removePackageConfig

public void removePackageConfig(String name)
Description copied from interface: Configuration
Remove the PackageConfig for package with name as name.

Specified by:
removePackageConfig in interface Configuration
Parameters:
name - package name to be removed

WebWork Project Page