|
Groovy 1.8.4 | |||||||
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 existence 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-existent 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, values, clone, isEmpty, size, entrySet, putAll, remove, keySet, containsKey, equals, toString, hashCode, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class HashMap | |
---|---|
get, put, values, clone, clear, isEmpty, size, entrySet, putAll, remove, keySet, containsKey, containsValue, equals, toString, hashCode, wait, wait, wait, getClass, notify, notifyAll |
Property Detail |
---|
static final def KEYWORDS
static final def TAB_CHARACTER
URL configFile
Constructor Detail |
---|
ConfigObject(URL file)
ConfigObject()
Method Detail |
---|
Map flatten()
Map flatten(Map target)
def getProperty(String name)
Map merge(ConfigObject other)
other
- The ConfigObject to merge with
Properties toProperties()
Properties toProperties(String prefix)
prefix
- The prefix to append before property entries
Writer writeTo(Writer outArg)
Copyright © 2003-2011 The Codehaus. All rights reserved.