public class Indexer extends SpelNodeImpl
Modifier and Type | Field and Description |
---|---|
private PropertyAccessor |
cachedReadAccessor |
private java.lang.String |
cachedReadName |
private java.lang.Class<?> |
cachedReadTargetType |
private PropertyAccessor |
cachedWriteAccessor |
private java.lang.String |
cachedWriteName |
private java.lang.Class<?> |
cachedWriteTargetType |
children, pos
Constructor and Description |
---|
Indexer(int pos,
SpelNodeImpl expr) |
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
accessArrayElement(java.lang.Object ctx,
int idx) |
private void |
checkAccess(int arrayLength,
int index) |
TypedValue |
getValueInternal(ExpressionState state) |
private boolean |
growCollection(ExpressionState state,
TypeDescriptor targetType,
int index,
java.util.Collection collection)
Attempt to grow the specified collection so that the specified index is valid.
|
boolean |
isWritable(ExpressionState expressionState)
Determine if this expression node will support a setValue() call.
|
private void |
setArrayElement(ExpressionState state,
java.lang.Object ctx,
int idx,
java.lang.Object newValue,
java.lang.Class clazz) |
void |
setValue(ExpressionState state,
java.lang.Object newValue)
Evaluate the expression to a node and then set the new value on that node.
|
java.lang.String |
toStringAST() |
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, nextChildIs
private java.lang.String cachedReadName
private java.lang.Class<?> cachedReadTargetType
private PropertyAccessor cachedReadAccessor
private java.lang.String cachedWriteName
private java.lang.Class<?> cachedWriteTargetType
private PropertyAccessor cachedWriteAccessor
public Indexer(int pos, SpelNodeImpl expr)
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException
getValueInternal
in class SpelNodeImpl
EvaluationException
public boolean isWritable(ExpressionState expressionState) throws SpelEvaluationException
SpelNode
isWritable
in interface SpelNode
isWritable
in class SpelNodeImpl
expressionState
- the current expression state (includes the context)SpelEvaluationException
public void setValue(ExpressionState state, java.lang.Object newValue) throws EvaluationException
SpelNode
setValue
in interface SpelNode
setValue
in class SpelNodeImpl
state
- the current expression state (includes the context)newValue
- the new valueEvaluationException
- if any problem occurs evaluating the expression or setting the new valueprivate boolean growCollection(ExpressionState state, TypeDescriptor targetType, int index, java.util.Collection collection)
state
- the expression stateelementType
- the type of the elements in the collectionindex
- the index into the collection that needs to be validcollection
- the collection to grow with elementspublic java.lang.String toStringAST()
toStringAST
in interface SpelNode
toStringAST
in class SpelNodeImpl
private void setArrayElement(ExpressionState state, java.lang.Object ctx, int idx, java.lang.Object newValue, java.lang.Class clazz) throws EvaluationException
EvaluationException
private java.lang.Object accessArrayElement(java.lang.Object ctx, int idx) throws SpelEvaluationException
SpelEvaluationException
private void checkAccess(int arrayLength, int index) throws SpelEvaluationException
SpelEvaluationException