|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A ConfigObject at a simple level is a Map that creates configuration entries (other ConfigObjects) when referencing them. This means that navigating to foo.bar.stuff will not return null but nested ConfigObjects which are of course empty maps The Groovy truth can be used to check for the existance of "real" entries.
Field Summary | |
---|---|
def |
KEYWORDS
|
def |
TAB_CHARACTER
|
URL |
configFile
|
Constructor Summary | |
ConfigObject(URL file)
The config file that was used when parsing this ConfigObject |
|
ConfigObject()
|
Method Summary | |
---|---|
def |
convertValuesToString(def props)
|
Map |
flatten()
A ConfigObject is a tree structure consisting of nested maps. |
Map |
flatten(Map target)
Flattens this ConfigObject populating the results into the target Map |
def |
getProperty(String name)
Overrides the default getProperty implementation to create nested ConfigObject instances on demand for non-existant keys |
Map |
merge(ConfigObject other)
Merges the given map with this ConfigObject overriding any matching configuration entries in this ConfigObject |
def |
merge(Map config, Map other)
|
def |
populate(def suffix, def config, def map)
|
Properties |
toProperties()
Converts this ConfigObject into a the java.util.Properties format, flattening the tree structure beforehand |
Properties |
toProperties(String prefix)
Converts this ConfigObject ino the java.util.Properties format, flatten the tree and prefixing all entries with the given prefix |
def |
writeConfig(String prefix, ConfigObject map, def out, Integer tab, boolean apply)
|
def |
writeNode(def key, def space, def tab, def value, def out)
|
Writer |
writeTo(Writer outArg)
Writes this config object into a String serialized representation which can later be parsed back using the parse() method |
def |
writeValue(def key, def space, def prefix, def value, def out)
|
Constructor Detail |
---|
public ConfigObject(URL file)
public ConfigObject()
Method Detail |
---|
def convertValuesToString(def props)
Map flatten()
Map flatten(Map target)
public def getProperty(String name)
Map merge(ConfigObject other)
def merge(Map config, Map other)
def populate(def suffix, def config, def map)
Properties toProperties()
Properties toProperties(String prefix)
def writeConfig(String prefix, ConfigObject map, def out, Integer tab, boolean apply)
def writeNode(def key, def space, def tab, def value, def out)
Writer writeTo(Writer outArg)
def writeValue(def key, def space, def prefix, def value, def out)