org.springframework.extensions.config
Class ConfigImpl

java.lang.Object
  extended by org.springframework.extensions.config.ConfigImpl
All Implemented Interfaces:
Config

public class ConfigImpl
extends Object
implements Config

Default implementation of the Config interface, this should be used as the base class for any customisations

Author:
gavinc

Constructor Summary
ConfigImpl()
          Default constructor
ConfigImpl(ConfigImpl config)
          Construct a ConfigImpl using the contents of an existing ConfigImpl
 
Method Summary
 ConfigElement getConfigElement(String name)
          Returns the config element with the given name, if there is more than one with the given name the first one added is returned.
 Map<String,ConfigElement> getConfigElements()
          Returns all the config elements
 String getConfigElementValue(String name)
          Shortcut method to get the config element with the given name and return its value.
 boolean hasConfigElement(String name)
          Determines whether the given config element exists
 void putConfigElement(ConfigElement configElement)
          Adds a config element to the results of the lookup replacing any config element already present with the same name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigImpl

public ConfigImpl()
Default constructor


ConfigImpl

public ConfigImpl(ConfigImpl config)
Construct a ConfigImpl using the contents of an existing ConfigImpl

Parameters:
config - The instance to create this one from
Method Detail

getConfigElement

public ConfigElement getConfigElement(String name)
Description copied from interface: Config
Returns the config element with the given name, if there is more than one with the given name the first one added is returned.

Specified by:
getConfigElement in interface Config
Parameters:
name - Name of the config element to retrieve
Returns:
The ConfigElement object or null if it doesn't exist
See Also:
Config.getConfigElement(java.lang.String)

getConfigElementValue

public String getConfigElementValue(String name)
Description copied from interface: Config
Shortcut method to get the config element with the given name and return its value. If the config element does not exist, null is returned. If there is more than one with the given name the first one added is returned.

Specified by:
getConfigElementValue in interface Config
Parameters:
name - Name of the config element value to retrieve
Returns:
The ConfigElement value or null if it doesn't exist
See Also:
Config.getConfigElementValue(java.lang.String)

hasConfigElement

public boolean hasConfigElement(String name)
Description copied from interface: Config
Determines whether the given config element exists

Specified by:
hasConfigElement in interface Config
Parameters:
name - The name of the config element to look for
Returns:
true if the config element exists
See Also:
Config.hasConfigElement(java.lang.String)

getConfigElements

public Map<String,ConfigElement> getConfigElements()
Description copied from interface: Config
Returns all the config elements

Specified by:
getConfigElements in interface Config
Returns:
All the config elements
See Also:
Config.getConfigElements()

putConfigElement

public void putConfigElement(ConfigElement configElement)
Adds a config element to the results of the lookup replacing any config element already present with the same name

Parameters:
configElement - The config element to add


Copyright © 2009 SpringSource, Inc. All Rights Reserved.