|
Groovy 1.7.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
groovy.util.ConfigObject
class ConfigObject extends LinkedHashMap
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.
Property Summary | |
---|---|
static def |
KEYWORDS
|
static def |
TAB_CHARACTER
|
URL |
configFile
The config file that was used when parsing this ConfigObject |
Constructor Summary | |
ConfigObject(URL file)
|
|
ConfigObject()
|
Method Summary | |
---|---|
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 |
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 |
Writer
|
writeTo(Writer outArg)
Writes this config object into a String serialized representation which can later be parsed back using the parse() method |
Methods inherited from class LinkedHashMap | |
---|---|
get, clear, containsValue, put, clone, isEmpty, entrySet, putAll, size, values, remove, keySet, containsKey, hashCode, equals, toString, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class HashMap | |
---|---|
get, put, clone, clear, isEmpty, entrySet, putAll, size, values, remove, keySet, containsKey, containsValue, hashCode, equals, toString, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class AbstractMap | |
---|---|
get, put, hashCode, clear, equals, toString, isEmpty, entrySet, putAll, size, values, remove, keySet, containsKey, containsValue, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Property Detail |
---|
static final def KEYWORDS
static final def TAB_CHARACTER
URL configFile
Constructor Detail |
---|
public ConfigObject(URL file)
public ConfigObject()
Method Detail |
---|
Map flatten()
Map flatten(Map target)
public def getProperty(String name)
Map merge(ConfigObject other)
Properties toProperties()
Properties toProperties(String prefix)
Writer writeTo(Writer outArg)
Copyright © 2003-2009 The Codehaus. All rights reserved.