|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectgriffon.util.ConfigReader
class ConfigReader
Updated version of groovy.util.ConfigSlurper.
New features include:
Field Summary | |
---|---|
private static def |
ENVIRONMENTS_METHOD
|
private Map |
bindingVars
|
private Map |
conditionValues
|
private Stack |
conditionalBlocks
|
private Stack |
currentConditionalBlock
|
Property Summary | |
---|---|
GroovyClassLoader |
classLoader
|
Constructor Summary | |
ConfigReader()
|
|
ConfigReader(String env)
Constructs a new ConfigReader instance using the given environment |
Method Summary | |
---|---|
Map
|
getConditionalBlockValues()
|
String
|
getEnvironment()
|
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
|
registerConditionalBlock(String blockName, String blockValue)
|
void
|
setBinding(Map vars)
|
void
|
setEnvironment(String environment)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
private static final def ENVIRONMENTS_METHOD
private Map bindingVars
private final Map conditionValues
private final Stack conditionalBlocks
private Stack currentConditionalBlock
Property Detail |
---|
GroovyClassLoader classLoader
Constructor Detail |
---|
ConfigReader()
ConfigReader(String env)
env
- The Environment to use
Method Detail |
---|
Map getConditionalBlockValues()
String getEnvironment()
ConfigObject parse(Properties properties)
The
- java.util.Properties instance
ConfigObject parse(String script)
ConfigObject parse(Class scriptClass)
ConfigObject parse(Script script)
script
- The script to parse
ConfigObject parse(URL scriptLocation)
scriptLocation
- The location of the script to parse
ConfigObject parse(Script script, URL location)
script
- The groovy.lang.Script instancelocation
- The original location of the Script as a URL
void registerConditionalBlock(String blockName, String blockValue)
void setBinding(Map vars)
void setEnvironment(String environment)
Groovy Documentation