This resolver handles base objects that are Java language arrays. It accepts any 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 |
| 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. property argument.
|
| public Iterator | Returns: null.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)Overrides jakarta.
Deprecated
for removal since 5.0. This method will be removed without replacement in EL 6.0
Always returns null, since there is no reason to iterate through set set of all integers.
|
| 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 index of the element in the array to return the acceptable type for. Will be coerced into an
integer, but otherwise ignored by this resolver. property)Implements abstract jakarta. |
| public Object | Returns: If thepropertyResolved property of ELContext was set to true, then
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 The index of the value to be returned. Will be coerced into an integer. property)Implements abstract jakarta. |
| 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 index of the element in the array to return the acceptable type for. Will be coerced into an
integer, but otherwise ignored by this resolver. property)Implements abstract jakarta. setValue will always fail.
|
| 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 index of the value to be set. Will be coerced into an integer. property, Object The value to be set at the given index. val)Implements abstract jakarta. |
| private int |
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly | |
| 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 | |
| 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 Always returns
The
| |
| 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 value at the given index. The index is specified by 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, this method will always return
| |
| 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, attempts to set the value at the given index with the given value. The
index is specified by the
If the base is a Java language array, the
If this resolver was constructed in read-only mode, this method will always throw
| |
| toInteger | back to summary |
|---|---|
| private int toInteger(Object p) | |