| Modifier and Type | Field and Description |
|---|---|
| private URL | configFile
The config file that was used when parsing this ConfigObject |
| private HashMap | |
| pack-priv static final Collection | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. |
| public ConfigObject | Returns: a shallow copy of this ConfigObjectOverrides java. |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| private static Properties | |
| private Map | |
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public Map | |
| public Map | |
| public Object | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public URL | |
| public Object | getProperty(String
the name of the property of interest name)Overrides default groovy. |
| public boolean | |
| public Boolean | |
| public Set | |
| public Map | Returns: The result of the mergeThe ConfigObject to merge with other)Merges the given map with this ConfigObject overriding any matching configuration entries in this ConfigObject |
| private void | |
| public String | |
| public Object | put(Object
key with which the specified value is to be associated key, Object value to be associated with the specified key value)Implements java. |
| public void | putAll(Map<K, V>
mappings to be stored in this map m)Implements java. |
| public Object | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
| public void | |
| public int | |
| public Properties | Returns: A java.util.Properties instanceConverts this ConfigObject into a the java.util.Properties format, flattening the tree structure beforehand |
| public Properties | Returns: A java.util.Properties instanceThe prefix to append before property entries prefix)Converts this ConfigObject ino the java.util.Properties format, flatten the tree and prefixing all entries with the given prefix |
| public String | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|
| private void | |
| private void | |
| public Writer | writeTo(Writer
the Writer to which this Writable should output its data. outArg)Implements groovy. |
| private static void |
| configFile | back to summary |
|---|---|
| private URL configFile The config file that was used when parsing this ConfigObject | |
| delegateMap | back to summary |
|---|---|
| private HashMap<K, V> delegateMap | |
| KEYWORDS | back to summary |
|---|---|
| pack-priv static final Collection<String> KEYWORDS | |
| TAB_CHARACTER | back to summary |
|---|---|
| pack-priv static final String TAB_CHARACTER | |
| ConfigObject | back to summary |
|---|---|
| public ConfigObject(URL file) | |
| ConfigObject | back to summary |
|---|---|
| public ConfigObject() | |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns. | |
| clone | back to summary |
|---|---|
| public ConfigObject clone() Overrides java. Returns a shallow copy of this ConfigObject, keys and configuration entries are not cloned.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Doc from java. Returns
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Doc from java. Returns
| |
| convertValuesToString | back to summary |
|---|---|
| private static Properties convertValuesToString(Map<K, V> props) | |
| doMerge | back to summary |
|---|---|
| private Map | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a
| |
| flatten | back to summary |
|---|---|
| public Map A ConfigObject is a tree structure consisting of nested maps. This flattens the maps into a single level structure like a properties file | |
| flatten | back to summary |
|---|---|
| public Map Flattens this ConfigObject populating the results into the target Map
| |
| get | back to summary |
|---|---|
| public Object get(Object key) Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| getConfigFile | back to summary |
|---|---|
| public URL getConfigFile() | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) Overrides default groovy. Overrides the default getProperty implementation to create nested ConfigObject instances on demand for non-existent keys
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| isSet | back to summary |
|---|---|
| public Boolean isSet(String option) Checks if a config option is set. Example usage:
def config = new ConfigSlurper().parse("foo { password='' }")
assert config.foo.isSet('password')
assert config.foo.isSet('username') == false
The check works only for options one block below the current block.
E.g. config.isSet('foo.password') will always return false.
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a
| |
| merge | back to summary |
|---|---|
| public Map Merges the given map with this ConfigObject overriding any matching configuration entries in this ConfigObject
| |
| populate | back to summary |
|---|---|
| private void populate(String suffix, Map<K, V> config, Map<K, V> map) | |
| prettyPrint | back to summary |
|---|---|
| public String prettyPrint() | |
| put | back to summary |
|---|---|
| public Object put(Object key, Object value) Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<K, V> m) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling
| |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| setConfigFile | back to summary |
|---|---|
| public void setConfigFile(URL configFile) | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| toProperties | back to summary |
|---|---|
| public Properties toProperties() Converts this ConfigObject into a the java.util.Properties format, flattening the tree structure beforehand
| |
| toProperties | back to summary |
|---|---|
| public Properties toProperties(String prefix) Converts this ConfigObject ino the java.util.Properties format, flatten the tree and prefixing all entries with the given prefix
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |
| writeConfig | back to summary |
|---|---|
| private void writeConfig(String prefix, ConfigObject map, BufferedWriter out, int tab, boolean apply) throws IOException | |
| writeNode | back to summary |
|---|---|
| private void writeNode(String key, String space, int tab, ConfigObject value, BufferedWriter out) throws IOException | |
| writeTo | back to summary |
|---|---|
| public Writer writeTo(Writer outArg) throws IOException Implements groovy. Writes this config object into a String serialized representation which can later be parsed back using the parse() method
| |
| writeValue | back to summary |
|---|---|
| private static void writeValue(String key, String space, String prefix, Object value, BufferedWriter out) throws IOException | |