public abstract class SpelNodeImpl extends Object implements SpelNode
Modifier and Type | Field and Description |
---|---|
protected SpelNodeImpl[] |
children |
protected int |
pos |
Constructor and Description |
---|
SpelNodeImpl(int pos,
SpelNodeImpl... operands) |
Modifier and Type | Method and Description |
---|---|
SpelNode |
getChild(int index)
Helper method that returns a SpelNode rather than an Antlr Tree node.
|
int |
getChildCount() |
int |
getEndPosition() |
Class<?> |
getObjectClass(Object obj)
Determine the class of the object passed in, unless it is already a class object.
|
protected SpelNodeImpl |
getPreviousChild() |
int |
getStartPosition() |
TypedValue |
getTypedValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the typed value.
|
Object |
getValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the value.
|
protected <T> T |
getValue(ExpressionState state,
Class<T> desiredReturnType) |
abstract TypedValue |
getValueInternal(ExpressionState expressionState) |
protected ValueRef |
getValueRef(ExpressionState state) |
boolean |
isWritable(ExpressionState expressionState)
Determine if this expression node will support a setValue() call.
|
protected boolean |
nextChildIs(Class... clazzes) |
void |
setValue(ExpressionState expressionState,
Object newValue)
Evaluate the expression to a node and then set the new value on that node.
|
abstract String |
toStringAST() |
protected int pos
protected SpelNodeImpl[] children
public SpelNodeImpl(int pos, SpelNodeImpl... operands)
protected SpelNodeImpl getPreviousChild()
protected boolean nextChildIs(Class... clazzes)
public final Object getValue(ExpressionState expressionState) throws EvaluationException
SpelNode
getValue
in interface SpelNode
expressionState
- the current expression state (includes the context)EvaluationException
public final TypedValue getTypedValue(ExpressionState expressionState) throws EvaluationException
SpelNode
getTypedValue
in interface SpelNode
expressionState
- the current expression state (includes the context)EvaluationException
public boolean isWritable(ExpressionState expressionState) throws EvaluationException
SpelNode
isWritable
in interface SpelNode
expressionState
- the current expression state (includes the context)EvaluationException
- if something went wrong trying to determine if the node supports writingpublic void setValue(ExpressionState expressionState, Object newValue) throws EvaluationException
SpelNode
setValue
in interface SpelNode
expressionState
- the current expression state (includes the context)newValue
- the new valueEvaluationException
- if any problem occurs evaluating the expression or setting the new valuepublic SpelNode getChild(int index)
SpelNode
public int getChildCount()
getChildCount
in interface SpelNode
public Class<?> getObjectClass(Object obj)
SpelNode
getObjectClass
in interface SpelNode
obj
- the object that the caller wants the class ofprotected final <T> T getValue(ExpressionState state, Class<T> desiredReturnType) throws EvaluationException
EvaluationException
public abstract TypedValue getValueInternal(ExpressionState expressionState) throws EvaluationException
EvaluationException
public abstract String toStringAST()
toStringAST
in interface SpelNode
public int getStartPosition()
getStartPosition
in interface SpelNode
public int getEndPosition()
getEndPosition
in interface SpelNode
protected ValueRef getValueRef(ExpressionState state) throws EvaluationException
EvaluationException