This resolver handles base objects of any type, as long as the base is not null. It accepts any object
as a property or method, and coerces it to a string.
For property resolution, the property string is used to find a JavaBeans compliant property on the base object. The value is accessed using JavaBeans getters and setters.
For method resolution, the method string is the name of the method in the bean. The parameter types can be optionally specified to identify the method. If the parameter types are not specified, the parameter objects are used in the method resolution.
The JavaBeans specification predates the introduction of default method implementations defined on an interface. In addition to the JavaBeans specification requirements for looking up property getters, property setters and methods, this resolver also considers default methods and includes them in the results.
This resolver can be constructed in read-only mode, which means that isReadOnly will always return
true and setValue will always throw PropertyNotWritableException.
ELResolvers are combined together using CompositeELResolvers, to define rich semantics for
evaluating an expression. See the javadocs for ELResolver for details.
Because this resolver handles base objects of any type, it should be placed near the end of a composite resolver. Otherwise, it will claim to have resolved a property before any resolvers that come after it get a chance to test if they can do so as well.
CompositeELResolver, ELResolver
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final BeanELResolver. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BeanELResolver(boolean
true if this resolver cannot modify beans; false otherwise.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private BeanELResolver. | |
| public Class | Returns: null if base is null; otherwise Object.class.The context of this evaluation. context, Object The bean to analyze. base)Implements abstract jakarta. null, returns the most general type that this resolver accepts for the
property argument.
|
| public Iterator | Returns: AnIterator containing zero or more FeatureDescriptor objects, each representing a
property on this bean, or null if the base object is null.The context of this evaluation. context, Object The bean to analyze. base)Overrides jakarta.
Deprecated
for removal since 5.0. This method will be removed without replacement in EL 6.0
If the base object is not null, returns an Iterator containing the set of JavaBeans
properties available on the given object.
|
| public Class | Returns: If thepropertyResolved property of ELContext was set to true, then
the most general acceptable type which must be null if the either the property or the resolver is
read-only; otherwise undefinedThe context of this evaluation. context, Object The bean to analyze. base, Object The name of the property to analyze. Will be coerced to a property)String.Implements abstract jakarta. null, returns the most general acceptable type that can be set on this bean
property.
|
| public Object | Returns: If thepropertyResolved property of ELContext was set to true, then
the value of the given property. Otherwise, undefined.The context of this evaluation. context, Object The bean on which to get the property. base, Object The name of the property to get. Will be coerced to a property)String.Implements abstract jakarta. null, returns the current value of the given property on this bean.
|
| public Object | Returns: The result of the method invocation (null if the method has a void return type).The context of this evaluation. context, Object The bean on which to invoke the method base, Object The simple name of the method to invoke. Will be coerced to a methodName, Class<?>[] String. If method is
"<init>"or "<clinit>" a MethodNotFoundException is thrown.An array of Class objects identifying the method's formal parameter types, in declared order. Use
an empty array if the method has no parameters. Can be paramTypes, Object[] null, in which case the method's formal parameter
types are assumed to be unknown.The parameters to pass to the method, or params)null if no parameters.Overrides jakarta. null, invoke the method, with the given parameters on this bean.
|
| public boolean | Returns: If thepropertyResolved property of ELContext was set to true, then
true if calling the setValue method will always fail or false if it is
possible that such a call may succeed; otherwise undefined.The context of this evaluation. context, Object The bean to analyze. base, Object The name of the property to analyzed. Will be coerced to a property)String.Implements abstract jakarta. null, returns whether a call to setValue will always fail.
|
| public void | setValue(ELContext
The context of this evaluation. context, Object The bean on which to set the property. base, Object The name of the property to set. Will be coerced to a property, Object String.The value to be associated with the specified key. val)Implements abstract jakarta. null, attempts to set the value of the given property on this bean.
|
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly | |
| properties | back to summary |
|---|---|
| private final BeanELResolver. | |
| BeanELResolver | back to summary |
|---|---|
| public BeanELResolver() Creates a new read/write | |
| BeanELResolver | back to summary |
|---|---|
| public BeanELResolver(boolean isReadOnly) Creates a new
| |
| getBeanProperty | back to summary |
|---|---|
| private BeanELResolver. | |
| getCommonPropertyType | back to summary |
|---|---|
| public Class Implements abstract jakarta. If the base object is not
Assuming the base is not | |
| getFeatureDescriptors | back to summary |
|---|---|
| public Iterator Overrides jakarta. Deprecated for removal since 5.0. This method will be removed without replacement in EL 6.0 If the base object is not
The
| |
| getType | back to summary |
|---|---|
| public Class Implements abstract jakarta. If the base object is not
If the base is not
The provided property will first be coerced to a
| |
| getValue | back to summary |
|---|---|
| public Object getValue(ELContext context, Object base, Object property) Implements abstract jakarta. If the base object is not
If the base is not
The provided property name will first be coerced to a
| |
| invoke | back to summary |
|---|---|
| public Object invoke(ELContext context, Object base, Object methodName, Class<?>[] paramTypes, Object[] params) Overrides jakarta. If the base object is not
If the base is not
The provided method object will first be coerced to a
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly(ELContext context, Object base, Object property) Implements abstract jakarta. If the base object is not
If the base is not
If this resolver was constructed in read-only mode, this method will always return
The provided property name will first be coerced to a
| |
| setValue | back to summary |
|---|---|
| public void setValue(ELContext context, Object base, Object property, Object val) Implements abstract jakarta. If the base object is not
If the base is not
If this resolver was constructed in read-only mode, this method will always throw
The provided property name will first be coerced to a
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public BeanELResolver. | |
| private void |
| propertyMap | back to summary |
|---|---|
| private final Map<String, BeanELResolver. | |
| BeanProperties | back to summary |
|---|---|
| public BeanProperties(Class<?> baseClass) | |
| getBeanProperty | back to summary |
|---|---|
| public BeanELResolver. | |
| populateFromInterfaces | back to summary |
|---|---|
| private void populateFromInterfaces(Class<?> baseClass, Class<?> aClass) throws IntrospectionException | |
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private final PropertyDescriptor | |
| private Method | |
| private Method |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Class | |
| public Method | |
| public Method | |
| public boolean |
| baseClass | back to summary |
|---|---|
| private final Class<?> baseClass | |
| descriptor | back to summary |
|---|---|
| private final PropertyDescriptor descriptor | |
| readMethod | back to summary |
|---|---|
| private Method readMethod | |
| writeMethod | back to summary |
|---|---|
| private Method writeMethod | |
| BeanProperty | back to summary |
|---|---|
| public BeanProperty(Class<?> baseClass, PropertyDescriptor descriptor) | |
| getPropertyType | back to summary |
|---|---|
| public Class | |
| getReadMethod | back to summary |
|---|---|
| public Method getReadMethod(Object base) | |
| getWriteMethod | back to summary |
|---|---|
| public Method getWriteMethod(Object base) | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly(Object base) | |
| Access | Constructor and Description |
|---|---|
| pack-priv | BPSoftReference(Class<?> key, BeanELResolver.
|
| key | back to summary |
|---|---|
| pack-priv final Class<?> key | |
| BPSoftReference | back to summary |
|---|---|
| pack-priv BPSoftReference(Class<?> key, BeanELResolver. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private ConcurrentHashMap | |
| private ReferenceQueue | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public BeanELResolver. | get(Object
the key whose associated value is to be returned key)Overrides java. Implements java. null if this map contains no mapping for the key.
|
| public BeanELResolver. | put(Class<?>
key with which the specified value is to be associated key, BeanELResolver.value to be associated with the specified key valueOverrides java. Implements java. |
| public BeanELResolver. | putIfAbsent(Class<?>
key with which the specified value is to be associated key, BeanELResolver.value to be associated with the specified key valueOverrides java. Overrides default java. Implements java. |
| CACHE_INIT_SIZE | back to summary |
|---|---|
| private static final int CACHE_INIT_SIZE | |
| map | back to summary |
|---|---|
| private ConcurrentHashMap<Class<?>, BeanELResolver. | |
| refQ | back to summary |
|---|---|
| private ReferenceQueue<BeanELResolver. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| SoftConcurrentHashMap | back to summary |
|---|---|
| private SoftConcurrentHashMap() | |
| cleanup | back to summary |
|---|---|
| private void cleanup() | |
| get | back to summary |
|---|---|
| public BeanELResolver. Overrides java. Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
| |
| put | back to summary |
|---|---|
| public BeanELResolver. Overrides java. Implements java. Doc from java. Maps the specified key to the specified value in this table. Neither the key nor the value can be null. The value can be retrieved by calling the
| |
| putIfAbsent | back to summary |
|---|---|
| public BeanELResolver. Overrides java. Overrides default java. Implements java. Doc from java. If the specified key is not already associated
with a value, associates it with the given value.
This is equivalent to, for this
except that the action is performed atomically.
| |