org.springframework.expression.spel.ast
Class Selection
java.lang.Object
org.antlr.runtime.tree.BaseTree
org.antlr.runtime.tree.CommonTree
org.springframework.expression.spel.ast.SpelNode
org.springframework.expression.spel.ast.Selection
- All Implemented Interfaces:
- java.io.Serializable, org.antlr.runtime.tree.Tree
public class Selection
- extends SpelNode
Represents selection over a map or collection. For example: {1,2,3,4,5,6,7,8,9,10}.?{#isEven(#this) == 'y'} returns
[2, 4, 6, 8, 10]
Basically a subset of the input data is returned based on the evaluation of the expression supplied as selection
criteria.
- Author:
- Andy Clement
- See Also:
- Serialized Form
|
Field Summary |
static int |
ALL
|
static int |
FIRST
|
static int |
LAST
|
| Fields inherited from class org.antlr.runtime.tree.CommonTree |
startIndex, stopIndex, token |
| Fields inherited from class org.antlr.runtime.tree.BaseTree |
children |
| Fields inherited from interface org.antlr.runtime.tree.Tree |
INVALID_NODE |
|
Constructor Summary |
Selection(org.antlr.runtime.Token payload,
int variant)
|
|
Method Summary |
java.lang.Object |
getValue(ExpressionState state)
Evaluate the expression node in the context of the supplied expression state and return the value. |
boolean |
isWritable(ExpressionState expressionState)
Determine if this expression node will support a setValue() call. |
java.lang.String |
toStringAST()
|
| Methods inherited from class org.antlr.runtime.tree.CommonTree |
dupNode, getCharPositionInLine, getLine, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, isNil, setTokenStartIndex, setTokenStopIndex, toString |
| Methods inherited from class org.antlr.runtime.tree.BaseTree |
addChild, addChildren, createChildrenList, deleteChild, dupTree, getChildCount, getFirstChildWithType, setChild, toStringTree |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ALL
public static final int ALL
- See Also:
- Constant Field Values
FIRST
public static final int FIRST
- See Also:
- Constant Field Values
LAST
public static final int LAST
- See Also:
- Constant Field Values
Selection
public Selection(org.antlr.runtime.Token payload,
int variant)
getValue
public java.lang.Object getValue(ExpressionState state)
throws EvaluationException
- Description copied from class:
SpelNode
- Evaluate the expression node in the context of the supplied expression state and return the value.
- Specified by:
getValue in class SpelNode
- Parameters:
state - the current expression state (includes the context)
- Returns:
- the value of this node evaluated against the specified state
- Throws:
EvaluationException
toStringAST
public java.lang.String toStringAST()
- Specified by:
toStringAST in class SpelNode
- Returns:
- the string form of this AST node
isWritable
public boolean isWritable(ExpressionState expressionState)
throws SpelException
- Description copied from class:
SpelNode
- Determine if this expression node will support a setValue() call.
- Overrides:
isWritable in class SpelNode
- Parameters:
expressionState - the current expression state (includes the context)
- Returns:
- true if the expression node will allow setValue()
- Throws:
SpelException