org.apache.ojb.broker.util.configuration
Interface Configuration

All Known Implementing Classes:
ConfigurationAbstractImpl, LoggingConfiguration, OjbConfiguration

public interface Configuration

The Configuration interface defines lookup-methods to lookup typed configuration-values. For example boolean getBoolean(String key, boolean defaultValue) looks up a boolean value associated with key. If no value is found for key the boolean defaultValue is returned.

Version:
$Id: Configuration.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $
Author:
Thomas Mahler

Method Summary
 boolean getBoolean(String key, boolean defaultValue)
          Returns the boolean value for the specified key.
 Class getClass(String key, Class defaultValue)
          Returns the class specified by the value for the specified key.
 Class getClass(String key, Class defaultValue, Class assignable)
          Returns the class specified by the value for the specified key.
 Class getClass(String key, Class defaultValue, Class[] assignables)
          Returns the class specified by the value for the specified key.
 int getInteger(String key, int defaultValue)
          Returns the integer value for the specified key.
 String getString(String key, String defaultValue)
          Returns the string value for the specified key.
 String[] getStrings(String key, String defaultValue)
          Gets an array of Strings from the value of the specified key, seperated by ";".
 String[] getStrings(String key, String defaultValue, String seperators)
          Gets an array of Strings from the value of the specified key, seperated by any key from seperators.
 void setLogger(Logger loggerInstance)
          this method allows to set a logger that tracks configuration events.
 

Method Detail

setLogger

void setLogger(Logger loggerInstance)
this method allows to set a logger that tracks configuration events.

Parameters:
loggerInstance - the logger to set

getBoolean

boolean getBoolean(String key,
                   boolean defaultValue)
Returns the boolean value for the specified key. If no value for this key is found in the configuration or the value is not an legal boolean defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
Returns:
the value for the key, or defaultValue

getClass

Class getClass(String key,
               Class defaultValue,
               Class assignable)
Returns the class specified by the value for the specified key. If no value for this key is found in the configuration, no class of this name can be found or the specified class is not assignable assignable defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
assignable - a classe and/or interface the specified class must extend/implement.
Returns:
the value for the key, or defaultValue

getClass

Class getClass(String key,
               Class defaultValue,
               Class[] assignables)
Returns the class specified by the value for the specified key. If no value for this key is found in the configuration, no class of this name can be found or the specified class is not assignable to each class/interface in assignables defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
assignables - classes and/or interfaces the specified class must extend/implement.
Returns:
the value for the key, or defaultValue

getClass

Class getClass(String key,
               Class defaultValue)
Returns the class specified by the value for the specified key. If no value for this key is found in the configuration or no class of this name can be found defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
Returns:
the value for the key, or defaultValue

getInteger

int getInteger(String key,
               int defaultValue)
Returns the integer value for the specified key. If no value for this key is found in the configuration or the value is not an legal integer defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
Returns:
the value for the key, or defaultValue

getString

String getString(String key,
                 String defaultValue)
Returns the string value for the specified key. If no value for this key is found in the configuration defaultValue is returned.

Parameters:
key - the key
defaultValue - the default value
Returns:
the value for the key, or defaultValue

getStrings

String[] getStrings(String key,
                    String defaultValue,
                    String seperators)
Gets an array of Strings from the value of the specified key, seperated by any key from seperators. If no value for this key is found the array contained in defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
seperators - the seprators to be used
Returns:
the strings for the key, or the strings contained in defaultValue

getStrings

String[] getStrings(String key,
                    String defaultValue)
Gets an array of Strings from the value of the specified key, seperated by ";". If no value for this key is found the array contained in defaultValue is returned.

Parameters:
key - the key
defaultValue - the default Value
Returns:
the strings for the key, or the strings contained in defaultValue


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.