|
Groovy 1.7.2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
groovy.util.ConfigObject
public 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.
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 |
Constructor Detail |
---|
public ConfigObject(URL file)
public ConfigObject()
Method Detail |
---|
public Map flatten()
public Map flatten(Map target)
public def getProperty(String name)
public Map merge(ConfigObject other)
public Properties toProperties()
public Properties toProperties(String prefix)
public Writer writeTo(Writer outArg)
Copyright © 2003-2010 The Codehaus. All rights reserved.