|
spring-webflow | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AttributeMap<V>
An immutable interface for accessing attributes in a backing map with string keys.
Implementations can optionally support listeners that will be notified when
they're bound in or unbound from the map.
| Method Summary | ||
|---|---|---|
boolean |
contains(java.lang.String attributeName)
Does the attribute with the provided name exist in this map? |
|
boolean |
contains(java.lang.String attributeName,
java.lang.Class<? extends V> requiredType)
Does the attribute with the provided name exist in this map and is its value of the specified required type? |
|
V |
get(java.lang.String attributeName)
Get an attribute value out of this map, returning null if not found. |
|
|
get(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Get an attribute value, asserting the value is of the required type. |
|
|
get(java.lang.String attributeName,
java.lang.Class<T> requiredType,
T defaultValue)
Get an attribute value, asserting the value is of the required type and returning the default value if not found. |
|
V |
get(java.lang.String attributeName,
V defaultValue)
Get an attribute value, returning the default value if no value is found. |
|
|
getArray(java.lang.String attributeName,
java.lang.Class<? extends T[]> requiredType)
Returns an array attribute value in the map and makes sure it is of the required type. |
|
java.lang.Boolean |
getBoolean(java.lang.String attributeName)
Returns a boolean attribute value in the map, returning null if no value was found. |
|
java.lang.Boolean |
getBoolean(java.lang.String attributeName,
java.lang.Boolean defaultValue)
Returns a boolean attribute value in the map, returning the default value if no value was found. |
|
java.util.Collection<V> |
getCollection(java.lang.String attributeName)
Returns a collection attribute value in the map. |
|
|
getCollection(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Returns a collection attribute value in the map and make sure it is of the required type. |
|
java.lang.Integer |
getInteger(java.lang.String attributeName)
Returns an integer attribute value in the map, returning null if no value was found. |
|
java.lang.Integer |
getInteger(java.lang.String attributeName,
java.lang.Integer defaultValue)
Returns an integer attribute value in the map, returning the default value if no value was found. |
|
java.lang.Long |
getLong(java.lang.String attributeName)
Returns a long attribute value in the map, returning null if no value was found. |
|
java.lang.Long |
getLong(java.lang.String attributeName,
java.lang.Long defaultValue)
Returns a long attribute value in the map, returning the default value if no value was found. |
|
|
getNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Returns a number attribute value in the map that is of the specified type, returning null if no
value was found. |
|
|
getNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType,
T defaultValue)
Returns a number attribute value in the map of the specified type, returning the default value if no value was found. |
|
V |
getRequired(java.lang.String attributeName)
Get the value of a required attribute, throwing an exception of no attribute is found. |
|
|
getRequired(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Get the value of a required attribute and make sure it is of the required type. |
|
|
getRequiredArray(java.lang.String attributeName,
java.lang.Class<? extends T[]> requiredType)
Returns an array attribute value in the map, throwing an exception if the attribute is not present or not an array of the required type. |
|
java.lang.Boolean |
getRequiredBoolean(java.lang.String attributeName)
Returns a boolean attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
|
java.util.Collection<V> |
getRequiredCollection(java.lang.String attributeName)
Returns a collection attribute value in the map, throwing an exception if the attribute is not present or not a collection. |
|
|
getRequiredCollection(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Returns a collection attribute value in the map, throwing an exception if the attribute is not present or not a collection of the required type. |
|
java.lang.Integer |
getRequiredInteger(java.lang.String attributeName)
Returns an integer attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
|
java.lang.Long |
getRequiredLong(java.lang.String attributeName)
Returns a long attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
|
|
getRequiredNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType)
Returns a number attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
|
java.lang.String |
getRequiredString(java.lang.String attributeName)
Returns a string attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
|
java.lang.String |
getString(java.lang.String attributeName)
Returns a string attribute value in the map, returning null if no value was found. |
|
java.lang.String |
getString(java.lang.String attributeName,
java.lang.String defaultValue)
Returns a string attribute value in the map, returning the default value if no value was found. |
|
boolean |
isEmpty()
Is this attribute map empty with a size of 0? |
|
int |
size()
Returns the size of this map. |
|
AttributeMap<V> |
union(AttributeMap<? extends V> attributes)
Returns a new attribute map containing the union of this map with the provided map. |
|
| Methods inherited from interface org.springframework.binding.collection.MapAdaptable |
|---|
asMap |
| Method Detail |
|---|
V get(java.lang.String attributeName)
null if not found.
attributeName - the attribute name
int size()
boolean isEmpty()
boolean contains(java.lang.String attributeName)
attributeName - the attribute name
boolean contains(java.lang.String attributeName,
java.lang.Class<? extends V> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute namerequiredType - the required class of the attribute value
java.lang.IllegalArgumentException - when the value is not of the required type
V get(java.lang.String attributeName,
V defaultValue)
attributeName - the name of the attributedefaultValue - the default value
<T extends V> T get(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the name of the attributerequiredType - the required type of the attribute value
java.lang.IllegalArgumentException - when the value is not of the required type
<T extends V> T get(java.lang.String attributeName,
java.lang.Class<T> requiredType,
T defaultValue)
throws java.lang.IllegalStateException
attributeName - the name of the attributerequiredType - the value required typedefaultValue - the default value
java.lang.IllegalArgumentException - when the value (if found) is not of the required type
java.lang.IllegalStateException
V getRequired(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the name of the attribute
java.lang.IllegalArgumentException - when the attribute is not found
<T extends V> T getRequired(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
attributeName - name of the attribute to getrequiredType - the required type of the attribute value
java.lang.IllegalArgumentException - when the attribute is not found or not of the required type
java.lang.String getString(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
null if no value was found.
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is present but not a string
java.lang.String getString(java.lang.String attributeName,
java.lang.String defaultValue)
throws java.lang.IllegalArgumentException
attributeName - the attribute namedefaultValue - the default
java.lang.IllegalArgumentException - if the attribute is present but not a string
java.lang.String getRequiredString(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or present but not a string
java.util.Collection<V> getCollection(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is present but not a collection
<T extends java.util.Collection<V>> T getCollection(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute namerequiredType - the required type of the attribute value
java.lang.IllegalArgumentException - if the attribute is present but not a collection of the required type
java.util.Collection<V> getRequiredCollection(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or is present but not a collection
<T extends java.util.Collection<V>> T getRequiredCollection(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute namerequiredType - the required collection type
java.lang.IllegalArgumentException - if the attribute is not present or is present but not a collection of the
required type
<T extends V> T[] getArray(java.lang.String attributeName,
java.lang.Class<? extends T[]> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute namerequiredType - the required type of the attribute value
java.lang.IllegalArgumentException - if the attribute is present but not an array of the required type
<T extends V> T[] getRequiredArray(java.lang.String attributeName,
java.lang.Class<? extends T[]> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute namerequiredType - the required array type
java.lang.IllegalArgumentException - if the attribute is not present or is present but not a array of the required
type
<T extends java.lang.Number> T getNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
null if no
value was found.
attributeName - the attribute namerequiredType - the required number type
java.lang.IllegalArgumentException - if the attribute is present but not a number of the required type
<T extends java.lang.Number> T getNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType,
T defaultValue)
throws java.lang.IllegalArgumentException
attributeName - the attribute namedefaultValue - the default
java.lang.IllegalArgumentException - if the attribute is present but not a number of the required type
<T extends java.lang.Number> T getRequiredNumber(java.lang.String attributeName,
java.lang.Class<T> requiredType)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or present but not a number of the required type
java.lang.Integer getInteger(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
null if no value was found.
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is present but not an integer
java.lang.Integer getInteger(java.lang.String attributeName,
java.lang.Integer defaultValue)
throws java.lang.IllegalArgumentException
attributeName - the attribute namedefaultValue - the default
java.lang.IllegalArgumentException - if the attribute is present but not an integer
java.lang.Integer getRequiredInteger(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or present but not an integer
java.lang.Long getLong(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
null if no value was found.
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is present but not a long
java.lang.Long getLong(java.lang.String attributeName,
java.lang.Long defaultValue)
throws java.lang.IllegalArgumentException
attributeName - the attribute namedefaultValue - the default
java.lang.IllegalArgumentException - if the attribute is present but not a long
java.lang.Long getRequiredLong(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or present but not a long
java.lang.Boolean getBoolean(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
null if no value was found.
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is present but not a boolean
java.lang.Boolean getBoolean(java.lang.String attributeName,
java.lang.Boolean defaultValue)
throws java.lang.IllegalArgumentException
attributeName - the attribute namedefaultValue - the default
java.lang.IllegalArgumentException - if the attribute is present but not a boolean
java.lang.Boolean getRequiredBoolean(java.lang.String attributeName)
throws java.lang.IllegalArgumentException
attributeName - the attribute name
java.lang.IllegalArgumentException - if the attribute is not present or present but is not a booleanAttributeMap<V> union(AttributeMap<? extends V> attributes)
attributes - the map to combine with this map
|
spring-webflow | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||