public class MapELResolver extends ELResolver
Map
.
This resolver handles base objects of type java.util.Map
.
It accepts any object as a property and uses that object as a key in
the map. The resulting value is the value in the map that is associated with
that key.
This resolver can be constructed in read-only mode, which means that
isReadOnly
will always return true
and
setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
will always throw
PropertyNotWritableException
.
ELResolver
s are combined together using
CompositeELResolver
s, to define rich semantics for evaluating
an expression. See the javadocs for ELResolver
for details.
CompositeELResolver
,
ELResolver
,
Map
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor and Description |
---|
MapELResolver()
Creates a new read/write
MapELResolver . |
MapELResolver(boolean isReadOnly)
Creates a new
MapELResolver whose read-only status is
determined by the given parameter. |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getCommonPropertyType(ELContext context,
Object base)
If the base object is a map, returns the most general type that
this resolver accepts for the
property argument. |
Iterator<FeatureDescriptor> |
getFeatureDescriptors(ELContext context,
Object base)
If the base object is a map, returns an
Iterator
containing the set of keys available in the Map . |
Class<?> |
getType(ELContext context,
Object base,
Object property)
If the base object is a map, returns the most general acceptable type
for a value in this map.
|
Object |
getValue(ELContext context,
Object base,
Object property)
If the base object is a map, returns the value associated with the
given key, as specified by the
property argument. |
boolean |
isReadOnly(ELContext context,
Object base,
Object property)
If the base object is a map, returns whether a call to
setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail. |
void |
setValue(ELContext context,
Object base,
Object property,
Object val)
If the base object is a map, attempts to set the value associated with
the given key, as specified by the
property argument. |
convertToType, invoke