Enum JexlOperator

java.lang.Object
java.lang.Enum<JexlOperator>
org.apache.commons.jexl3.JexlOperator
All Implemented Interfaces:
Serializable, Comparable<JexlOperator>

public enum JexlOperator extends Enum<JexlOperator>
The JEXL operators. These are the operators that are executed by JexlArithmetic methods.

Each of them associates a symbol to a method signature. For instance, '+' is associated to 'T add(L x, R y)'.

The default JexlArithmetic implements generic versions of these methods using Object as arguments. You can use your own derived JexlArithmetic that override and/or overload those operator methods. Note that these are overloads by convention, not actual Java overloads. The following rules apply to all operator methods:

  • Operator methods should be public
  • Operators return type should be respected when primitive (int, boolean,...)
  • Operators may be overloaded multiple times with different signatures
  • Operators may return JexlEngine.TRY_AGAIN to fallback on default JEXL implementation
For side effect operators, operators that modify the left-hand size value (+=, -=, etc), the user implemented overload methods may return:
  • JexlEngine.TRY_FAIL to let the default fallback behavior be executed.
  • Any other value will be used as the new value to be assigned to the left-hand-side.
Note that side effect operators always return the left-hand side value (with an exception for postfix ++ and --).
Since:
3.0