play
Class Configuration

java.lang.Object
  extended by play.Configuration

public class Configuration
extends java.lang.Object

The current application configuration.


Constructor Summary
Configuration(play.api.Configuration conf)
          Creates a new configuration from a Scala-based configuration.
 
Method Summary
 java.lang.Boolean getBoolean(java.lang.String key)
          Retrieves a configuration value as a Boolean.
 java.lang.Long getBytes(java.lang.String key)
          Retrieves a configuration value as a Bytes.
 Configuration getConfig(java.lang.String key)
          Retrieves a sub-configuration, which is a configuration instance containing all keys that start with the given prefix.
 java.lang.Integer getInt(java.lang.String key)
          Retrieves a configuration value as an Int.
 java.lang.Long getMilliseconds(java.lang.String key)
          Retrieves a configuration value as a Milliseconds.
 java.lang.String getString(java.lang.String key)
          Retrieves a configuration value as a String.
 java.util.Set<java.lang.String> keys()
          Retrieves the set of keys available in this configuration.
 java.lang.RuntimeException reportError(java.lang.String key, java.lang.String message, java.lang.Throwable e)
          Creates a configuration error for a specific congiguration key.
static Configuration root()
          The root configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(play.api.Configuration conf)
Creates a new configuration from a Scala-based configuration.

Method Detail

root

public static Configuration root()
The root configuration.

Returns:
a Configuration instance

getConfig

public Configuration getConfig(java.lang.String key)
Retrieves a sub-configuration, which is a configuration instance containing all keys that start with the given prefix.

Parameters:
key - The root prefix for this sub configuration.
Returns:
Maybe a new configuration

getString

public java.lang.String getString(java.lang.String key)
Retrieves a configuration value as a String.

Parameters:
key - configuration key (relative to configuration root key)
Returns:
a configuration value or null

getMilliseconds

public java.lang.Long getMilliseconds(java.lang.String key)
Retrieves a configuration value as a Milliseconds.

Parameters:
key - configuration key (relative to configuration root key)
Returns:
a configuration value or null

getBytes

public java.lang.Long getBytes(java.lang.String key)
Retrieves a configuration value as a Bytes.

Parameters:
key - configuration key (relative to configuration root key)
Returns:
a configuration value or null

getInt

public java.lang.Integer getInt(java.lang.String key)
Retrieves a configuration value as an Int.

Parameters:
key - configuration key (relative to configuration root key)
Returns:
a configuration value or null

getBoolean

public java.lang.Boolean getBoolean(java.lang.String key)
Retrieves a configuration value as a Boolean.

Parameters:
key - configuration key (relative to configuration root key)
Returns:
a configuration value or null

keys

public java.util.Set<java.lang.String> keys()
Retrieves the set of keys available in this configuration.

Returns:
the set of keys available in this configuration

reportError

public java.lang.RuntimeException reportError(java.lang.String key,
                                              java.lang.String message,
                                              java.lang.Throwable e)
Creates a configuration error for a specific congiguration key.

Parameters:
key - the configuration key, related to this error
message - the error message
e - the optional related exception
Returns:
a configuration exception