|
Groovy 1.7.2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.util.ConfigSlurper
public class ConfigSlurper extends Object
ConfigSlurper is a utility class for reading configuration files defined in the form of Groovy scripts. Configuration settings can be defined using dot notation or scoped using closures
grails.webflow.stateless = true
smtp {
mail.host = 'smtp.myisp.com'
mail.auth.user = 'server'
}
resources.URL = "http://localhost:80/resources"
Settings can either be bound into nested maps or onto a specified JavaBean instance. In the case of the latter an error will be thrown if a property cannot be bound.
Constructor Summary | |
ConfigSlurper()
|
|
ConfigSlurper(String env)
Constructs a new ConfigSlurper instance using the given environment |
Method Summary | |
---|---|
ConfigObject
|
parse(Properties properties)
Parses a ConfigObject instances from an instance of java.util.Properties |
ConfigObject
|
parse(String script)
Parse the given script as a string and return the configuration object |
ConfigObject
|
parse(Class scriptClass)
Create a new instance of the given script class and parse a configuration object from it |
ConfigObject
|
parse(Script script)
Parse the given script into a configuration object (a Map) |
ConfigObject
|
parse(URL scriptLocation)
Parses a Script represented by the given URL into a ConfigObject |
ConfigObject
|
parse(Script script, URL location)
Parses the passed groovy.lang.Script instance using the second argument to allow the ConfigObject to retain an reference to the original location other Groovy script |
void
|
setBinding(Map vars)
Sets any additional variables that should be placed into the binding when evaluating Config scripts |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Constructor Detail |
---|
public ConfigSlurper()
public ConfigSlurper(String env)
Method Detail |
---|
public ConfigObject parse(Properties properties)
public ConfigObject parse(String script)
public ConfigObject parse(Class scriptClass)
public ConfigObject parse(Script script)
public ConfigObject parse(URL scriptLocation)
public ConfigObject parse(Script script, URL location)
public void setBinding(Map vars)
Copyright © 2003-2010 The Codehaus. All rights reserved.