? BaseDynaBeanMapDecorator<K>
- ????:
K
- the type of the keys in the decorated map
A base class for decorators providing Map
behavior on
DynaBean
s.
The motivation for this implementation is to provide access to DynaBean
properties in technologies that are unaware of BeanUtils and DynaBean
s -
such as the expression languages of JSTL and JSF.
This rather technical base class implements the methods of the
Map
interface on top of a DynaBean
. It was introduced
to handle generic parameters in a meaningful way without breaking
backwards compatibility of the DynaBeanMapDecorator
class: A
map wrapping a DynaBean
should be of type Map<String, Object>
.
However, when using these generic parameters in DynaBeanMapDecorator
this would be an incompatible change (as method signatures would have to
be adapted). To solve this problem, this generic base class is added
which allows specifying the key type as parameter. This makes it easy to
have a new subclass using the correct generic parameters while
DynaBeanMapDecorator
could still remain with compatible
parameters.
- ???????:
- BeanUtils 1.9.0
- ??:
- $Id$
-
?????
-
?????
????????BaseDynaBeanMapDecorator
(DynaBean dynaBean) Constructs a read only Map for the specifiedDynaBean
.BaseDynaBeanMapDecorator
(DynaBean dynaBean, boolean readOnly) Construct a Map for the specifiedDynaBean
. -
????
??????????void
clear()
clear() operation is not supported.boolean
containsKey
(Object key) Indicate whether theDynaBean
contains a specified value for one (or more) of its properties.boolean
containsValue
(Object value) Indicates whether the decoratedDynaBean
contains a specified value.protected abstract K
convertKey
(String propertyName) Converts the name of a property to the key type of this decorator.entrySet()
Returns the Set of the property/value mappings in the decoratedDynaBean
.Return the value for the specified key from the decoratedDynaBean
.Provide access to the underlyingDynaBean
this Map decorates.boolean
isEmpty()
Indicate whether the decoratedDynaBean
has any properties.boolean
Indicate whether the Map is read only.keySet()
Returns the Set of the property names in the decoratedDynaBean
.Set the value for the specified property in the decoratedDynaBean
.void
Copy the contents of a Map to the decoratedDynaBean
.remove() operation is not supported.int
size()
Returns the number properties in the decoratedDynaBean
.values()
Returns the set of property values in the decoratedDynaBean
.??????? java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
???????? java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
???????
-
BaseDynaBeanMapDecorator
Constructs a read only Map for the specifiedDynaBean
.- ??:
dynaBean
- The dyna bean being decorated- ??:
IllegalArgumentException
- if theDynaBean
is null.
-
BaseDynaBeanMapDecorator
Construct a Map for the specifiedDynaBean
.- ??:
dynaBean
- The dyna bean being decoratedreadOnly
-true
if the Map is read only otherwisefalse
- ??:
IllegalArgumentException
- if theDynaBean
is null.
-
-
??????
-
isReadOnly
Indicate whether the Map is read only.- ??:
true
if the Map is read only, otherwisefalse
.
-
clear
clear() operation is not supported.- ???:
clear
????Map<K,
Object> - ??:
UnsupportedOperationException
-
containsKey
Indicate whether theDynaBean
contains a specified value for one (or more) of its properties. -
containsValue
Indicates whether the decoratedDynaBean
contains a specified value.- ???:
containsValue
????Map<K,
Object> - ??:
value
- The value to check for.- ??:
true
if one of the theDynaBean
's properties contains the specified value, otherwisefalse
.
-
entrySet
Returns the Set of the property/value mappings in the decorated
DynaBean
.Each element in the Set is a
Map.Entry
type. -
get
Return the value for the specified key from the decoratedDynaBean
. -
isEmpty
Indicate whether the decoratedDynaBean
has any properties. -
keySet
Returns the Set of the property names in the decorated
DynaBean
.N.B.For
DynaBean
s whose associatedDynaClass
is aMutableDynaClass
a new Set is created every time, otherwise the Set is created only once and cached. -
put
Set the value for the specified property in the decoratedDynaBean
. -
putAll
Copy the contents of a Map to the decoratedDynaBean
.- ???:
putAll
????Map<K,
Object> - ??:
map
- The Map of values to copy.- ??:
UnsupportedOperationException
- ifisReadOnly()
is true.
-
remove
remove() operation is not supported. -
size
Returns the number properties in the decoratedDynaBean
. -
values
Returns the set of property values in the decoratedDynaBean
. -
getDynaBean
Provide access to the underlyingDynaBean
this Map decorates.- ??:
- the decorated
DynaBean
.
-
convertKey
Converts the name of a property to the key type of this decorator.- ??:
propertyName
- the name of a property- ??:
- the converted key to be used in the decorated map
-