org.springframework.expression.spel.ast
Class OperatorInstanceof
java.lang.Object
org.springframework.expression.spel.ast.SpelNodeImpl
org.springframework.expression.spel.ast.Operator
org.springframework.expression.spel.ast.OperatorInstanceof
- All Implemented Interfaces:
- SpelNode
public class OperatorInstanceof
- extends Operator
The operator 'instanceof' checks if an object is of the class specified in the right hand operand,
in the same way that instanceof
does in Java.
- Since:
- 3.0
- Author:
- Andy Clement
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl |
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OperatorInstanceof
public OperatorInstanceof(int pos,
SpelNodeImpl... operands)
getValueInternal
public BooleanTypedValue getValueInternal(ExpressionState state)
throws EvaluationException
- Compare the left operand to see it is an instance of the type specified as the right operand.
The right operand must be a class.
- Specified by:
getValueInternal
in class SpelNodeImpl
- Parameters:
state
- the expression state
- Returns:
- true if the left operand is an instanceof of the right operand, otherwise false
- Throws:
EvaluationException
- if there is a problem evaluating the expression