This resolver handles base objects that are Java language arrays. It accepts the case sensitive string "length" or any other object as a property and coerces that object into an integer index into the array. The
resulting value is the value in the array at that index.
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.
CompositeELResolver, ELResolver
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ArrayELResolver(boolean
true if this resolver cannot modify arrays; false otherwise.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: null if base is not a Java language array; otherwise Integer.class.The context of this evaluation. context, Object The array to analyze. Only bases that are a Java language array are handled by this resolver. base)Implements abstract jakarta. If the base object is a Java language array, returns the most general type that this resolver accepts for the
|
| 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 array to analyze. Only bases that are Java language arrays are handled by this resolver. base, Object The case sensitive string property)"length" or the index of the element in the array to return the
acceptable type for. If not the case sensitive string "length", will be coerced into an integer and
checked if it is a valid index for the array, but otherwise ignored by this resolver.Implements abstract jakarta. If the base object is an array, returns the most general acceptable type for a value in this array. |
| public Object | Returns: If thepropertyResolved property of ELContext was set to true, then the length of
the array, the value at the given index or null if the index was out of bounds. Otherwise, undefined.The context of this evaluation. context, Object The array to analyze. Only bases that are Java language arrays are handled by this resolver. base, Object Either the string property)"length" or the index of the value to be returned. An index value will
be coerced into an integer.Implements abstract jakarta. If the base object is a Java language array, returns the length of the array or the value at the given index. |
| 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 array to analyze. Only bases that are a Java language array are handled by this resolver. base, Object The case sensitive string property)length or an object to coerce to an integer to provide the
index to check if an attempt to call setValue with that index will always fail.Implements abstract jakarta. If the base object is a Java language array, returns whether a call to |
| public void | setValue(ELContext
The context of this evaluation. context, Object The array to be modified. Only bases that are Java language arrays are handled by this resolver. base, Object The case sensitive string property, Object length or an object to coerce to an integer to provide the
index of the value to be set.The value to be set at the given index. val)Implements abstract jakarta. If the base object is a Java language array and the property is not the case sensitive string |
| private int |
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly | |
| LENGTH_PROPERTY_NAME | back to summary |
|---|---|
| private static final String LENGTH_PROPERTY_NAME | |
| ArrayELResolver | back to summary |
|---|---|
| public ArrayELResolver() Creates a new read/write | |
| ArrayELResolver | back to summary |
|---|---|
| public ArrayELResolver(boolean isReadOnly) Creates a new
| |
| getCommonPropertyType | back to summary |
|---|---|
| public Class Implements abstract jakarta. If the base object is a Java language array, returns the most general type that this resolver accepts for the
Assuming the base is an array, this method will always return | |
| getType | back to summary |
|---|---|
| public Class Implements abstract jakarta. If the base object is an array, returns the most general acceptable type for a value in this array.
If the base is a
Assuming the base is an
| |
| getValue | back to summary |
|---|---|
| public Object getValue(ELContext context, Object base, Object property) Implements abstract jakarta. If the base object is a Java language array, returns the length of the array or the value at the given index. If
the
If the base is a Java language array, the
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly(ELContext context, Object base, Object property) Implements abstract jakarta. If the base object is a Java language array, returns whether a call to
If the base is a Java language array, the
If this resolver was constructed in read-only mode or the property is the case sensitive string
| |
| setValue | back to summary |
|---|---|
| public void setValue(ELContext context, Object base, Object property, Object val) Implements abstract jakarta. If the base object is a Java language array and the property is not the case sensitive string
If the base is a Java language array, the
If this resolver was constructed in read-only mode or the property is the case sensitive string
| |
| toInteger | back to summary |
|---|---|
| private int toInteger(Object p) | |