Class StandardOperatorOverloader
java.lang.Object
org.springframework.expression.spel.support.StandardOperatorOverloader
- All Implemented Interfaces:
OperatorOverloader
Standard implementation of
OperatorOverloader.- Since:
- 3.0
- Author:
- Juergen Hoeller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerform the specified operation on the two operands, returning a result.booleanoverridesOperation(Operation operation, Object leftOperand, Object rightOperand) Returntrueif this operator overloader supports the specified operation on the two operands and should be invoked to handle it.
-
Constructor Details
-
StandardOperatorOverloader
public StandardOperatorOverloader()
-
-
Method Details
-
overridesOperation
public boolean overridesOperation(Operation operation, @Nullable Object leftOperand, @Nullable Object rightOperand) throws EvaluationException Description copied from interface:OperatorOverloaderReturntrueif this operator overloader supports the specified operation on the two operands and should be invoked to handle it.- Specified by:
overridesOperationin interfaceOperatorOverloader- Parameters:
operation- the operation to be performedleftOperand- the left operandrightOperand- the right operand- Returns:
- true if this
OperatorOverloadersupports the specified operation between the two operands - Throws:
EvaluationException- if there is a problem performing the operation
-
operate
public Object operate(Operation operation, @Nullable Object leftOperand, @Nullable Object rightOperand) throws EvaluationException Description copied from interface:OperatorOverloaderPerform the specified operation on the two operands, returning a result.See
Operationfor supported operations.- Specified by:
operatein interfaceOperatorOverloader- Parameters:
operation- the operation to be performedleftOperand- the left operandrightOperand- the right operand- Returns:
- the result of performing the operation on the two operands
- Throws:
EvaluationException- if there is a problem performing the operation
-