org.hippoecm.hst.core.container
Class ContainerConfigurationImpl

java.lang.Object
  extended by org.hippoecm.hst.core.container.ContainerConfigurationImpl
All Implemented Interfaces:
ContainerConfiguration

public class ContainerConfigurationImpl
extends Object
implements ContainerConfiguration

Container Configuration Retrieve basic data types from the container configuration. This is a subset of Commons Configuration functionality.

Version:
$Id: ContainerConfigurationImpl.java 32892 2012-02-04 06:00:46Z wko $

Field Summary
protected  org.apache.commons.configuration.Configuration configuration
           
 
Constructor Summary
ContainerConfigurationImpl(org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 boolean containsKey(String key)
          Check if the configuration contains the specified key.
 boolean getBoolean(String key)
          Get a boolean associated with the given configuration key.
 boolean getBoolean(String key, boolean defaultValue)
          Get a boolean associated with the given configuration key.
 double getDouble(String key)
          Get a double associated with the given configuration key.
 double getDouble(String key, double defaultValue)
          Get a Double associated with the given configuration key.
 float getFloat(String key)
          Get a float associated with the given configuration key.
 float getFloat(String key, float defaultValue)
          Get a Float associated with the given configuration key.
 int getInt(String key)
          Get a int associated with the given configuration key.
 int getInt(String key, int defaultValue)
          Get a int associated with the given configuration key.
 Iterator getKeys()
          Get the list of the keys contained in the configuration.
 List getList(String key)
          Get a List of strings associated with the given configuration key.
 long getLong(String key)
          Get a long associated with the given configuration key.
 long getLong(String key, long defaultValue)
          Get a long associated with the given configuration key.
 String getString(String key)
          Get a string associated with the given configuration key.
 String getString(String key, String defaultValue)
          Get a string associated with the given configuration key.
 String[] getStringArray(String key)
          Get an array of strings associated with the given configuration key.
 boolean isDevelopmentMode()
          Checks if the container is running under development mode
 boolean isEmpty()
          Check if the configuration is empty.
 void setProperty(String key, Object value)
           
 Properties toProperties()
          Convert a ContainerConfiguration class into a Properties class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected org.apache.commons.configuration.Configuration configuration
Constructor Detail

ContainerConfigurationImpl

public ContainerConfigurationImpl(org.apache.commons.configuration.Configuration configuration)
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: ContainerConfiguration
Check if the configuration is empty.

Specified by:
isEmpty in interface ContainerConfiguration
Returns:
true if the configuration contains no property, false otherwise.

containsKey

public boolean containsKey(String key)
Description copied from interface: ContainerConfiguration
Check if the configuration contains the specified key.

Specified by:
containsKey in interface ContainerConfiguration
Parameters:
key - the key whose presence in this configuration is to be tested
Returns:
true if the configuration contains a value for this key, false otherwise

getBoolean

public boolean getBoolean(String key,
                          boolean defaultValue)
Description copied from interface: ContainerConfiguration
Get a boolean associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Specified by:
getBoolean in interface ContainerConfiguration
Returns:

getBoolean

public boolean getBoolean(String key)
Description copied from interface: ContainerConfiguration
Get a boolean associated with the given configuration key.

Specified by:
getBoolean in interface ContainerConfiguration
Returns:

getDouble

public double getDouble(String key,
                        double defaultValue)
Description copied from interface: ContainerConfiguration
Get a Double associated with the given configuration key.

Specified by:
getDouble in interface ContainerConfiguration
Returns:

getDouble

public double getDouble(String key)
Description copied from interface: ContainerConfiguration
Get a double associated with the given configuration key.

Specified by:
getDouble in interface ContainerConfiguration
Returns:

getFloat

public float getFloat(String key,
                      float defaultValue)
Description copied from interface: ContainerConfiguration
Get a Float associated with the given configuration key.

Specified by:
getFloat in interface ContainerConfiguration
Returns:

getFloat

public float getFloat(String key)
Description copied from interface: ContainerConfiguration
Get a float associated with the given configuration key.

Specified by:
getFloat in interface ContainerConfiguration
Returns:

getInt

public int getInt(String key,
                  int defaultValue)
Description copied from interface: ContainerConfiguration
Get a int associated with the given configuration key.

Specified by:
getInt in interface ContainerConfiguration
Returns:

getInt

public int getInt(String key)
Description copied from interface: ContainerConfiguration
Get a int associated with the given configuration key.

Specified by:
getInt in interface ContainerConfiguration
Returns:

getList

public List getList(String key)
Description copied from interface: ContainerConfiguration
Get a List of strings associated with the given configuration key.

Specified by:
getList in interface ContainerConfiguration
Returns:

getLong

public long getLong(String key,
                    long defaultValue)
Description copied from interface: ContainerConfiguration
Get a long associated with the given configuration key.

Specified by:
getLong in interface ContainerConfiguration
Returns:

getLong

public long getLong(String key)
Description copied from interface: ContainerConfiguration
Get a long associated with the given configuration key.

Specified by:
getLong in interface ContainerConfiguration
Returns:

getString

public String getString(String key,
                        String defaultValue)
Description copied from interface: ContainerConfiguration
Get a string associated with the given configuration key.

Specified by:
getString in interface ContainerConfiguration
Returns:

getString

public String getString(String key)
Description copied from interface: ContainerConfiguration
Get a string associated with the given configuration key.

Specified by:
getString in interface ContainerConfiguration
Returns:

getStringArray

public String[] getStringArray(String key)
Description copied from interface: ContainerConfiguration
Get an array of strings associated with the given configuration key.

Specified by:
getStringArray in interface ContainerConfiguration
Returns:

getKeys

public Iterator getKeys()
Description copied from interface: ContainerConfiguration
Get the list of the keys contained in the configuration.

Specified by:
getKeys in interface ContainerConfiguration
Returns:

isDevelopmentMode

public boolean isDevelopmentMode()
Description copied from interface: ContainerConfiguration
Checks if the container is running under development mode

Specified by:
isDevelopmentMode in interface ContainerConfiguration
Returns:

setProperty

public void setProperty(String key,
                        Object value)

toProperties

public Properties toProperties()
Description copied from interface: ContainerConfiguration
Convert a ContainerConfiguration class into a Properties class. List properties are joined into a string using the delimiter of the configuration.

Specified by:
toProperties in interface ContainerConfiguration
Returns:
Properties created from the Configuration


Copyright © 2008-2012 Hippo. All Rights Reserved.