Griffon 1.2.0

griffon.util
[Groovy] Class ConfigReader

java.lang.Object
  griffon.util.ConfigReader

class ConfigReader

Updated version of groovy.util.ConfigSlurper.
New features include:

Authors:
Graeme Rocher (Groovy 1.5)
Andres Almiray
Since:
1.1.0


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

ENVIRONMENTS_METHOD

private static final def ENVIRONMENTS_METHOD


bindingVars

private Map bindingVars


conditionValues

private final Map conditionValues


conditionalBlocks

private final Stack conditionalBlocks


currentConditionalBlock

private Stack currentConditionalBlock


 
Property Detail

classLoader

GroovyClassLoader classLoader


 
Constructor Detail

ConfigReader

ConfigReader()


ConfigReader

ConfigReader(String env)
Constructs a new ConfigReader instance using the given environment
Parameters:
env - The Environment to use


 
Method Detail

getConditionalBlockValues

Map getConditionalBlockValues()


getEnvironment

String getEnvironment()


parse

ConfigObject parse(Properties properties)
Parses a ConfigObject instances from an instance of java.util.Properties
Parameters:
The - java.util.Properties instance


parse

ConfigObject parse(String script)
Parse the given script as a string and return the configuration object
See Also:
ConfigReader.parse


parse

ConfigObject parse(Class scriptClass)
Create a new instance of the given script class and parse a configuration object from it
See Also:
ConfigReader.parse


parse

ConfigObject parse(Script script)
Parse the given script into a configuration object (a Map)
Parameters:
script - The script to parse
Returns:
A Map of maps that can be navigating with dot de-referencing syntax to obtain configuration entries


parse

ConfigObject parse(URL scriptLocation)
Parses a Script represented by the given URL into a ConfigObject
Parameters:
scriptLocation - The location of the script to parse
Returns:
The ConfigObject instance


parse

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
Parameters:
script - The groovy.lang.Script instance
location - The original location of the Script as a URL
Returns:
The ConfigObject instance


registerConditionalBlock

void registerConditionalBlock(String blockName, String blockValue)


setBinding

void setBinding(Map vars)


setEnvironment

void setEnvironment(String environment)


 

Groovy Documentation