|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
flex.messaging.config.ConfigMap
public class ConfigMap
The ConfigMap class is a helper implementation of Map that makes it easier to handle properties that can appear one or more times. If a property is set more than once, it is converted to a List and added as another property rather than replacing the existing property. It also provides utility APIs for getting properties from the Map, cast to a certain type and allows a default to be specified in the event that the property is missing.
| Constructor Summary | |
|---|---|
ConfigMap()
Constructs an empty ConfigMap with the default initial
capacity of 10. |
|
ConfigMap(ConfigMap m)
Constructs a new ConfigMap and copies the values
from the supplied map to this map. |
|
ConfigMap(int initialCapacity)
Constructs a new ConfigMap with the initial
capacity specified. |
|
| Method Summary | |
|---|---|
void |
addProperties(ConfigMap p)
Adds all properties from a map to this map. |
void |
addProperty(String name,
ConfigMap value)
Adds a ConfigMap value to this map for the given property
name. |
void |
addProperty(String name,
String value)
Adds a String value to this map for the given property
name. |
void |
allowProperty(String name)
Sets a property name as allowed without needing to access the property value. |
List |
findAllUnusedProperties()
Returns a list of qualified property names that have not been accessed by one of the get*() methods. |
void |
findUnusedProperties(String parentPath,
boolean recurse,
Collection result)
Gathers a collection of properties that exist in the map but have not been explicitly accessed nor marked as allowed. |
Object |
get(Object name)
Gets the value for the given property name. |
String |
getProperty(String name)
Gets the property with the specified name as a string if possible. |
boolean |
getPropertyAsBoolean(String name,
boolean defaultValue)
Gets the property with the specified name as a boolean if possible, or returns the default value if the property is undefined. |
int |
getPropertyAsInt(String name,
int defaultValue)
Gets the property with the specified name as an int if possible, or returns the default value if the property is undefined. |
List |
getPropertyAsList(String name,
List defaultValue)
Gets a property (or set of properties) as a List. |
long |
getPropertyAsLong(String name,
long defaultValue)
Gets the property with the specified name as a long if possible, or returns the default value if the property is undefined. |
ConfigMap |
getPropertyAsMap(String name,
ConfigMap defaultValue)
Gets the property with the specified name as a ConfigMap if possible, or returns the default value if the property is undefined. |
String |
getPropertyAsString(String name,
String defaultValue)
Gets the property with the specified name as a String if possible, or returns the default value if the property is undefined. |
Set |
propertyNames()
Gets the set of property names contained in this map. |
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear, containsValue |
| Methods inherited from class java.util.HashMap |
|---|
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Constructor Detail |
|---|
public ConfigMap()
ConfigMap with the default initial
capacity of 10.
public ConfigMap(int initialCapacity)
ConfigMap with the initial
capacity specified.
initialCapacity - the initial capacity.public ConfigMap(ConfigMap m)
ConfigMap and copies the values
from the supplied map to this map.
m - a ConfigMap whose properties are to be added to
this ConfigMap.| Method Detail |
|---|
public void addProperties(ConfigMap p)
p - a ConfigMap whose properties are to be added to
this ConfigMap.
public void addProperty(String name,
String value)
String value to this map for the given property
name.
name - the property namevalue - the property value
public void addProperty(String name,
ConfigMap value)
ConfigMap value to this map for the given property
name.
name - the property namevalue - the property valuepublic Set propertyNames()
Set of property name Strings.public void allowProperty(String name)
name - the property name to allowpublic Object get(Object name)
get in interface Mapget in class LinkedHashMapname - the property name
public String getProperty(String name)
ConfigurationException - if there are multiple values for the
property name.
public ConfigMap getPropertyAsMap(String name,
ConfigMap defaultValue)
ConfigurationException - if there are multiple values for the
property name.
public String getPropertyAsString(String name,
String defaultValue)
ConfigurationException - if there are multiple values for the
property name.
public List getPropertyAsList(String name,
List defaultValue)
name - the property namedefaultValue - the value to return if the property is not found
public boolean getPropertyAsBoolean(String name,
boolean defaultValue)
ConfigurationException - if there are multiple values for the
property name.
public int getPropertyAsInt(String name,
int defaultValue)
ConfigurationException - if there are multiple values for the
property name.
public long getPropertyAsLong(String name,
long defaultValue)
ConfigurationException - if there are multiple values for the
property name.public List findAllUnusedProperties()
public void findUnusedProperties(String parentPath,
boolean recurse,
Collection result)
parentPath - Used to track the depth of property in a potential
hierarchy of ConfigMaps.recurse - Whether sub maps should be recursively searched.result - the collection of unused properties in this map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/config/ConfigMap.html