org.koala.koalautil
Class ConfigurationManager

java.lang.Object
  |
  +--org.koala.koalautil.ConfigurationManager

public class ConfigurationManager
extends java.lang.Object

Handles system configuration through property files.


Method Summary
 double getDouble(java.lang.String key, double defaultValue)
          get the value for a double property
 java.util.GregorianCalendar getGregorianCalendar(java.lang.String key, java.util.GregorianCalendar defaultValue)
          get the value for a GregorianCalendar property
static org.koala.koalautil.ConfigurationManager getInstance()
          returns the instance for the default path
static org.koala.koalautil.ConfigurationManager getInstance(java.lang.String path)
          provides access to a given instance of the class
 int getInt(java.lang.String key, int defaultValue)
          get the value for an int property
 long getLong(java.lang.String key, long defaultValue)
          get the value for a long property
 java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
          get the value for a String property
 void setInt(java.lang.String key, int value)
          sets the value of an int property
 void setString(java.lang.String key, java.lang.String value)
          sets the value of a String property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setString

public void setString(java.lang.String key,
                      java.lang.String value)
               throws ChainedException
sets the value of a String property

Parameters:
key - property key
value - the value associated with the given key
Throws:
ChainedException - unspecified

setInt

public void setInt(java.lang.String key,
                   int value)
            throws ChainedException
sets the value of an int property

Parameters:
key - property key
value - the value associated with the given key
Throws:
ChainedException - unspecified

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String defaultValue)
                           throws ChainedException
get the value for a String property

Parameters:
key - property key
defaultValue - the value to return if the key does not exist on the property file
Returns:
the property value, if the property exists
Throws:
ChainedException - unspecified

getInt

public int getInt(java.lang.String key,
                  int defaultValue)
           throws ChainedException
get the value for an int property

Parameters:
key - property key
defaultValue - default value to return if the property does not exist on the file
Returns:
the property value as an int
Throws:
ChainedException - unspecified

getLong

public long getLong(java.lang.String key,
                    long defaultValue)
             throws ChainedException
get the value for a long property

Parameters:
key - property key
defaultValue - default value to return in case the key does not exist in the property file
Returns:
the value associated with the property as a long
Throws:
ChainedException - unspecified

getDouble

public double getDouble(java.lang.String key,
                        double defaultValue)
                 throws ChainedException
get the value for a double property

Parameters:
key - property key
defaultValue - default value to return if the key does not exist in the file
Returns:
the value associated with the property as a double
Throws:
ChainedException - unspecified

getGregorianCalendar

public java.util.GregorianCalendar getGregorianCalendar(java.lang.String key,
                                                        java.util.GregorianCalendar defaultValue)
                                                 throws ChainedException
get the value for a GregorianCalendar property

Parameters:
key - property key
defaultValue - default value to return in case the key does not exist on the file
Returns:
the value associated with the key as a GregorianCalendar
Throws:
ChainedException - unspecified

getInstance

public static org.koala.koalautil.ConfigurationManager getInstance(java.lang.String path)
                                                            throws ChainedException
provides access to a given instance of the class

Parameters:
path - the property file path for the instance we want to access
Returns:
the instance associated with the given path
Throws:
ChainedException - unspecified

getInstance

public static org.koala.koalautil.ConfigurationManager getInstance()
                                                            throws ChainedException
returns the instance for the default path

Returns:
returns the default instance
Throws:
ChainedException - unspecified