Top Description Fields Constructors Methods
org.springframework.expression.spel.ast

public Class OperatorBetween

extends Operator
Class Inheritance
Imports
java.util.List, org.springframework.expression.EvaluationException, .TypeComparator, org.springframework.expression.spel.ExpressionState, .SpelEvaluationException, .SpelMessage, org.springframework.expression.spel.support.BooleanTypedValue

Represents the between operator.

The left operand must be a single value, and the right operand must be a 2-element list which defines a range from a lower bound to an upper bound.

This operator returns true if the left operand is greater than or equal to the lower bound and less than or equal to the upper bound. Consequently, 1 between {1, 5} evaluates to true, while 1 between {5, 1} evaluates to false.

Authors
Andy Clement, Sam Brannen
Since
3.0

Field Summary

Inherited from org.springframework.expression.spel.ast.Operator:
leftActualDescriptorrightActualDescriptor

Constructor Summary

AccessConstructor and Description
public
OperatorBetween(int startPos, int endPos, SpelNodeImpl... operands)

Method Summary

Modifier and TypeMethod and Description
public BooleanTypedValue

Returns:

true if the left operand is in the range specified, false otherwise
getValueInternal
(ExpressionState
the expression state
state
)

Implements abstract org.springframework.expression.spel.ast.SpelNodeImpl.getValueInternal.

Returns a boolean based on whether a value is in the range expressed.
Inherited from org.springframework.expression.spel.ast.Operator:
equalityCheckgenerateComparisonCodegetLeftOperandgetOperatorNamegetRightOperandisCompilableOperatorUsingNumericstoStringAST

Constructor Detail

OperatorBetweenback to summary
public OperatorBetween(int startPos, int endPos, SpelNodeImpl... operands)

Method Detail

getValueInternalback to summary
public BooleanTypedValue getValueInternal(ExpressionState state) throws EvaluationException

Implements abstract org.springframework.expression.spel.ast.SpelNodeImpl.getValueInternal.

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 lower and upper bounds allowed for the first operand (inclusive).

Parameters
state:ExpressionState

the expression state

Returns:BooleanTypedValue

true if the left operand is in the range specified, false otherwise

Annotations
@Override
Exceptions
EvaluationException:
if there is a problem evaluating the expression