com.ingenta.clownbike
Class Configuration

java.lang.Object
  extended bycom.ingenta.clownbike.Configuration

public class Configuration
extends java.lang.Object

Configuration is used much like java.util.ResourceBundle. This class differs in that it has accessors with constructing the lookup key. Further, this class is expected to be added to as other configuration (or context) information is needed; For example the logger, locations of external resources, etc.


Constructor Summary
Configuration(java.util.ResourceBundle resources)
          Initialize the configuration using the resource bundle.
 
Method Summary
 boolean getBoolean(java.lang.Class context, java.lang.String name)
           
 boolean getBoolean(java.lang.Object context, java.lang.String name)
           
 boolean getBoolean(java.lang.String name)
           
 boolean getBoolean(java.lang.String name, boolean defaultValue)
           
 java.lang.Integer getInteger(java.lang.Class context, java.lang.String name)
           
 java.lang.Integer getInteger(java.lang.Object context, java.lang.String name)
           
 java.lang.Integer getInteger(java.lang.String name)
           
 java.lang.Integer getInteger(java.lang.String name, java.lang.Integer defaultValue)
           
 java.lang.String getString(java.lang.Class context, java.lang.String name)
          Returns the value associated with the given class and name.
 java.lang.String getString(java.lang.Object context, java.lang.String name)
          Returns the value associated with the given object's class and name.
 java.lang.String getString(java.lang.String name)
          Return the value associated with the given name
 java.lang.String getString(java.lang.String name, java.lang.String defaultValue)
          Return the value associated with the given name or default value.
 java.lang.String[] getStrings(java.lang.Class context, java.lang.String name)
          Returns the strings associated with the given class and name.
 java.lang.String[] getStrings(java.lang.Object context, java.lang.String name)
          Returns the strings associated with the given class and name.
 java.lang.String[] getStrings(java.lang.String name)
          Returns the strings associated with the given class and name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.util.ResourceBundle resources)
Initialize the configuration using the resource bundle.

Method Detail

getString

public java.lang.String getString(java.lang.String name,
                                  java.lang.String defaultValue)
Return the value associated with the given name or default value.


getString

public java.lang.String getString(java.lang.String name)
                           throws java.util.MissingResourceException
Return the value associated with the given name

Throws:
java.util.MissingResourceException

getString

public java.lang.String getString(java.lang.Class context,
                                  java.lang.String name)
                           throws java.util.MissingResourceException
Returns the value associated with the given class and name. The class' name is used to prefix the given name to get the lookup key. For example is the class is "com.ingenta.Foo" and name is "bar" the key used is "com.ingenta.Foo.bar".

Throws:
java.util.MissingResourceException

getString

public java.lang.String getString(java.lang.Object context,
                                  java.lang.String name)
                           throws java.util.MissingResourceException
Returns the value associated with the given object's class and name. The object's class' name is used to prefix the given name to get the lookup key. For example is the class is "com.ingenta.Foo" and name is "bar" the key used is "com.ingenta.Foo.bar".

Throws:
java.util.MissingResourceException

getStrings

public java.lang.String[] getStrings(java.lang.String name)
                              throws java.util.MissingResourceException
Returns the strings associated with the given class and name. The strings are separated by whitespace in the orignal value.

Throws:
java.util.MissingResourceException

getStrings

public java.lang.String[] getStrings(java.lang.Class context,
                                     java.lang.String name)
                              throws java.util.MissingResourceException
Returns the strings associated with the given class and name. The strings are separated by whitespace in the orignal value.

Throws:
java.util.MissingResourceException

getStrings

public java.lang.String[] getStrings(java.lang.Object context,
                                     java.lang.String name)
                              throws java.util.MissingResourceException
Returns the strings associated with the given class and name. The strings are separated by whitespace in the orignal value.

Throws:
java.util.MissingResourceException

getInteger

public java.lang.Integer getInteger(java.lang.String name,
                                    java.lang.Integer defaultValue)

getInteger

public java.lang.Integer getInteger(java.lang.String name)
                             throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException

getInteger

public java.lang.Integer getInteger(java.lang.Class context,
                                    java.lang.String name)
                             throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException

getInteger

public java.lang.Integer getInteger(java.lang.Object context,
                                    java.lang.String name)
                             throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException

getBoolean

public boolean getBoolean(java.lang.String name,
                          boolean defaultValue)

getBoolean

public boolean getBoolean(java.lang.String name)
                   throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException

getBoolean

public boolean getBoolean(java.lang.Class context,
                          java.lang.String name)
                   throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException

getBoolean

public boolean getBoolean(java.lang.Object context,
                          java.lang.String name)
                   throws java.util.MissingResourceException
Throws:
java.util.MissingResourceException