org.slim3.commons.config
Class Configuration

java.lang.Object
  extended by org.slim3.commons.config.Configuration

public final class Configuration
extends Object

A class to access the configuration information.

Since:
3.0
Author:
higa

Field Summary
static String COOL
          cool value.
static String DEFAULT_PATH
          The default path.
static String DEPLOYMENT_KEY
          The deployment key.
static String HOT
          hot value.
static String PRODUCTION
          production value.
static String ROOT_PACKAGES_KEY
          The key for root packages.
static String STAGE_KEY
          The stage key.
 
Method Summary
static Boolean getBooleanValue(String key)
          Returns the boolean value for the key.
static Byte getByteValue(String key)
          Returns the byte value for the key.
static String getDeployment()
          Returns the deployment value.
static Double getDoubleValue(String key)
          Returns the double value for the key.
static Float getFloatValue(String key)
          Returns the float value for the key.
static Integer getIntegerValue(String key)
          Returns the integer value for the key.
static Long getLongValue(String key)
          Returns the long value for the key.
static String[] getRootPackages()
          Returns the root packages.
static Short getShortValue(String key)
          Returns the short value for the key.
static String getStage()
          Returns the stage value.
static String getStringValue(String key)
          Returns the string value for the key.
static void initialize()
          Initializes the configuration information.
static void initialize(String path)
          Initializes the configuration information.
static boolean isCoolDeployment()
          Determines if the deployment is "cool".
static boolean isHotDeployment()
          Determines if the deployment is "hot".
protected static String toLongKey(String key)
          Converts the short key to a long key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STAGE_KEY

public static final String STAGE_KEY
The stage key.

See Also:
Constant Field Values

DEPLOYMENT_KEY

public static final String DEPLOYMENT_KEY
The deployment key.

See Also:
Constant Field Values

HOT

public static final String HOT
hot value.

See Also:
Constant Field Values

COOL

public static final String COOL
cool value.

See Also:
Constant Field Values

PRODUCTION

public static final String PRODUCTION
production value.

See Also:
Constant Field Values

DEFAULT_PATH

public static final String DEFAULT_PATH
The default path.

See Also:
Constant Field Values

ROOT_PACKAGES_KEY

public static final String ROOT_PACKAGES_KEY
The key for root packages.

See Also:
Constant Field Values
Method Detail

initialize

public static void initialize()
Initializes the configuration information.


initialize

public static void initialize(String path)
Initializes the configuration information.

Parameters:
path - the path for the configuration file
Throws:
NullPointerException - if the path parameter is null
IllegalArgumentException - if an IO exception is encountered

getStage

public static String getStage()
Returns the stage value.

Returns:
the stage value
Throws:
IllegalStateException - if the stage value is null

getDeployment

public static String getDeployment()
Returns the deployment value.

Returns:
the deployment value
Throws:
IllegalStateException - if the deployment value is null

getRootPackages

public static String[] getRootPackages()
Returns the root packages.

Returns:
the root packages

getStringValue

public static String getStringValue(String key)
Returns the string value for the key.

Parameters:
key - the key
Returns:
the string value.
Throws:
NullPointerException - if the key parameter is null.

toLongKey

protected static String toLongKey(String key)
Converts the short key to a long key.

Parameters:
key - the short key
Returns:
a long key

getByteValue

public static Byte getByteValue(String key)
Returns the byte value for the key.

Parameters:
key - the key
Returns:
the byte value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getShortValue

public static Short getShortValue(String key)
Returns the short value for the key.

Parameters:
key - the key
Returns:
the short value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getIntegerValue

public static Integer getIntegerValue(String key)
Returns the integer value for the key.

Parameters:
key - the key
Returns:
the integer value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getLongValue

public static Long getLongValue(String key)
Returns the long value for the key.

Parameters:
key - the key
Returns:
the long value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getFloatValue

public static Float getFloatValue(String key)
Returns the float value for the key.

Parameters:
key - the key
Returns:
the float value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getDoubleValue

public static Double getDoubleValue(String key)
Returns the double value for the key.

Parameters:
key - the key
Returns:
the float value
Throws:
IllegalArgumentException - if an exception is encountered while converting

getBooleanValue

public static Boolean getBooleanValue(String key)
Returns the boolean value for the key.

Parameters:
key - the key
Returns:
the boolean value
Throws:
IllegalArgumentException - if an exception is encountered while converting

isHotDeployment

public static boolean isHotDeployment()
Determines if the deployment is "hot".

Returns:
whether the deployment is "hot"

isCoolDeployment

public static boolean isCoolDeployment()
Determines if the deployment is "cool".

Returns:
whether the deployment is "cool"


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.