|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport grails.util.GrailsConfig
public class GrailsConfig
General purpose Grails Configuration Utility for retieving configuration options with the ability to log warnings on type/constraint mismatch
Method Summary | ||
---|---|---|
static
|
get(String key)
Utility method for retrieving a configuration value |
|
static
|
get(String key,
Class<T> type)
Utility method for retrieving a configuration value and performs type checking (i.e. logs a verbose WARN message on type mismatch) |
|
static
|
get(String key,
T defaultValue)
Configuration Value lookup with a default value |
|
static
|
get(String key,
T defaultValue,
List<T> allowedValues)
Configuration Value lookup with a default value and a list of allowed values |
|
static Object |
getAt(Object key)
Configuration Value lookup for Groovy's array-like property access GrailsConfig['my.config.key'] |
|
static
|
getMandatory(String key)
Configuration Value lookup with thows a GrailsConfigurationException when the value is null |
|
static
|
getMandatory(String key,
List<T> 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 |
---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> T get(String key)
T
- the type parameterkey
- the flattened key
public static <T> T get(String key, Class<T> type)
T
- the type parameterkey
- the flattened keytype
- the required type
public static <T> T get(String key, T defaultValue)
T
- the type parameterkey
- the flattened keydefaultValue
- the default value
defaultValue
public static <T> T get(String key, T defaultValue, List<T> allowedValues)
T
- the type parameterkey
- the flattened keydefaultValue
- the default valueallowedValues
- List of allowed values
allowedValues
, otherwise the defaultValue
public static <T> T getMandatory(String key)
T
- the type parameterkey
- the flattened key
public static <T> T getMandatory(String key, List<T> allowedValues)
T
- the type parameterkey
- the flattened keyallowedValues
- List of allowed values
public static Object getAt(Object key)
GrailsConfig['my.config.key']
key
- the config key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |