Class OperatorBetween

  extended by org.springframework.expression.spel.ast.SpelNodeImpl
      extended by org.springframework.expression.spel.ast.Operator
          extended by org.springframework.expression.spel.ast.OperatorBetween
All Implemented Interfaces:

public class OperatorBetween
extends Operator

Represents the between operator. The left operand to between must be a single value and the right operand must be a list - this operator returns true if the left operand is between (using the registered comparator) the two elements in the list. The definition of between being inclusive follows the SQL BETWEEN definition.

Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorBetween(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
          Returns a boolean based on whether a value is in the range expressed.
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
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

Constructor Detail


public OperatorBetween(int pos,
                       SpelNodeImpl... operands)
Method Detail


public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Returns a boolean based on whether a value is in the range expressed. The first operand is any value whilst the second is a list of two values - those two values being the bounds allowed for the first operand (inclusive).

Specified by:
getValueInternal in class SpelNodeImpl
state - the expression state
true if the left operand is in the range specified, false otherwise
EvaluationException - if there is a problem evaluating the expression