public class MapConfiguration extends AbstractConfiguration implements Cloneable
A Map based Configuration.
Note:Configuration objects of this type can be read concurrently by multiple threads. However if one of these threads modifies the object, synchronization has to be performed manually.
Modifier and Type | Field and Description |
---|---|
protected Map |
map
The Map decorated by this configuration.
|
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN
Constructor and Description |
---|
MapConfiguration(Map map)
Create a Configuration decorator around the specified Map.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPropertyDirect(String key,
Object value)
Adds a key/value pair to the Configuration.
|
protected void |
clearPropertyDirect(String key)
Removes the specified property from this configuration.
|
Object |
clone()
Returns a copy of this object.
|
boolean |
containsKey(String key)
Check if the configuration contains the specified key.
|
Iterator |
getKeys()
Get the list of the keys contained in the configuration.
|
Map |
getMap()
Return the Map decorated by this configuration.
|
Object |
getProperty(String key)
Gets a property from the configuration.
|
boolean |
isEmpty()
Check if the configuration is empty.
|
addErrorLogListener, addProperty, append, clear, clearProperty, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setProperty, setThrowExceptionOnMissing, subset
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents
protected Map map
public MapConfiguration(Map map)
map
- the mappublic Map getMap()
public Object getProperty(String key)
Configuration
Configuration
interface the other get methods (that
return specific data types) will internally make use of this method. On
this level variable substitution is not yet performed. The returned
object is an internal representation of the property value for the passed
in key. It is owned by the Configuration
object. So a caller
should not modify this object. It cannot be guaranteed that this object
will stay constant over time (i.e. further update operations on the
configuration may change its internal state).getProperty
in interface Configuration
key
- property to retrieveprotected void addPropertyDirect(String key, Object value)
AbstractConfiguration
addPropertyDirect
in class AbstractConfiguration
key
- key to use for mappingvalue
- object to storepublic boolean isEmpty()
Configuration
isEmpty
in interface Configuration
true
if the configuration contains no property,
false
otherwise.public boolean containsKey(String key)
Configuration
containsKey
in interface Configuration
key
- the key whose presence in this configuration is to be testedtrue
if the configuration contains a value for this
key, false
otherwiseprotected void clearPropertyDirect(String key)
AbstractConfiguration
clearProperty()
after it has done some
preparations. It should be overriden in sub classes. This base
implementation is just left empty.clearPropertyDirect
in class AbstractConfiguration
key
- the key to be removedpublic Iterator getKeys()
Configuration
remove()
method is specific to
a concrete implementation. It may remove the corresponding
property from the configuration, but this is not guaranteed. In any case
it is no replacement for calling
Configuration.clearProperty(String)
for this property. So it is
highly recommended to avoid using the iterator's remove()
method.getKeys
in interface Configuration
public Object clone()
clone
in class EventSource
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.