org.springframework.expression.spel.ast
Class OperatorInstanceof

java.lang.Object
  extended by org.antlr.runtime.tree.BaseTree
      extended by org.antlr.runtime.tree.CommonTree
          extended by org.springframework.expression.spel.ast.SpelNode
              extended by org.springframework.expression.spel.ast.Operator
                  extended by org.springframework.expression.spel.ast.OperatorInstanceof
All Implemented Interfaces:
java.io.Serializable, org.antlr.runtime.tree.Tree

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.

Author:
Andy Clement
See Also:
Serialized Form

Field Summary
 
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
OperatorInstanceof(org.antlr.runtime.Token payload)
           
 
Method Summary
 java.lang.String getOperatorName()
           
 java.lang.Boolean getValue(ExpressionState state)
          Compare the left operand to see it is an instance of the type specified as the right operand.
 
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getRightOperand, isWritable, toStringAST
 
Methods inherited from class org.springframework.expression.spel.ast.SpelNode
getChild, getObjectClass, getTokenName, getValue, setValue
 
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
 

Constructor Detail

OperatorInstanceof

public OperatorInstanceof(org.antlr.runtime.Token payload)
Method Detail

getOperatorName

public java.lang.String getOperatorName()
Specified by:
getOperatorName in class Operator

getValue

public java.lang.Boolean getValue(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:
getValue in class SpelNode
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