|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport grails.util.GrailsConfig
@Deprecated @SuppressWarnings("rawtypes") public class GrailsConfig extends groovy.lang.GroovyObjectSupport
General purpose Grails Configuration Utility for retieving configuration options with the ability to log warnings on type/constraint mismatch.
Method Summary | |
---|---|
static java.lang.Object
|
get(java.lang.String key)
Utility method for retrieving a configuration value. |
static java.lang.Object
|
get(java.lang.String key, java.lang.Class type)
Utility method for retrieving a configuration value and performs type checking (i.e. logs a verbose WARN message on type mismatch). |
static java.lang.Object
|
get(java.lang.String key, java.lang.Object defaultValue)
Configuration Value lookup with a default value. |
static java.lang.Object
|
get(java.lang.String key, java.lang.Object defaultValue, java.util.List allowedValues)
Configuration Value lookup with a default value and a list of allowed values. |
static java.lang.Object
|
getAt(java.lang.Object key)
Configuration Value lookup for Groovy's array-like property access |
static java.lang.Object
|
getMandatory(java.lang.String key)
Configuration Value lookup with thows a GrailsConfigurationException when the value is null |
static java.lang.Object
|
getMandatory(java.lang.String key, java.util.List allowedValues)
Configuration Value lookup with thows a GrailsConfigurationException when the value is null or not within the allowedValues. |
Methods inherited from class groovy.lang.GroovyObjectSupport | |
---|---|
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
@SuppressWarnings("unchecked") public static java.lang.Object get(java.lang.String key)
key
- the flattened key
- the type parameter
public static java.lang.Object get(java.lang.String key, java.lang.Class type)
key
- the flattened keytype
- the required type
- the type parameter
@SuppressWarnings("unchecked") public static java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
key
- the flattened keydefaultValue
- the default value
- the type parameterdefaultValue
public static java.lang.Object get(java.lang.String key, java.lang.Object defaultValue, java.util.List allowedValues)
key
- the flattened keydefaultValue
- the default valueallowedValues
- List of allowed values
- the type parameterallowedValues
, otherwise the defaultValue
public static java.lang.Object getAt(java.lang.Object key)
GrailsConfig['my.config.key']
key
- the config key
@SuppressWarnings("unchecked") public static java.lang.Object getMandatory(java.lang.String key)
key
- the flattened key
- the type parameter
@SuppressWarnings("unchecked") public static java.lang.Object getMandatory(java.lang.String key, java.util.List allowedValues)
key
- the flattened keyallowedValues
- List of allowed values
- the type parameter
Groovy Documentation