net.sf.jsefa.common.config
Class InitialConfiguration

java.lang.Object
  extended by net.sf.jsefa.common.config.InitialConfiguration

public final class InitialConfiguration
extends Object

The single initial configuration for JSefa. See sub interfaces of InitialConfigurationParameters for the available parameters.

Author:
Norman Lahme-Huetig
See Also:
Configuration

Method Summary
static
<T> T
get(String parameter, Object defaultValue)
          Returns the value of the given parameter.
static
<T> T
get(String parameter, OnDemandObjectProvider defaultValueProvider)
          Returns the value of the given parameter.
static void set(String parameter, Object value)
          Sets the parameter value of the given parameter to the given value if the parameter is not already bound to another value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static <T> T get(String parameter,
                        OnDemandObjectProvider defaultValueProvider)
Returns the value of the given parameter. If none is configured for the parameter, the defaultValue retrieved from the OnDemandObjectProvider is registered and returned.

Type Parameters:
T - the expected type of the parameter value
Parameters:
parameter - the parameter
defaultValueProvider - the provider of the default value to use if none is configured for the parameter in question.
Returns:
the value of the parameter

get

public static <T> T get(String parameter,
                        Object defaultValue)
Returns the value of the given parameter. If none is configured for the parameter, the defaultValue is registered and returned.

Type Parameters:
T - the expected type of the parameter value
Parameters:
parameter - the parameter
defaultValue - the default value to use if none is configured for the parameter in question.
Returns:
the value of the parameter

set

public static void set(String parameter,
                       Object value)
Sets the parameter value of the given parameter to the given value if the parameter is not already bound to another value. Otherwise an InitialConfigurationException will be thrown.

Parameters:
parameter - the parameter
value - the value
Throws:
InitialConfigurationException - if the parameter is already bound to another value.


Copyright © 2014. All rights reserved.