Package org.apache.commons.jexl3
Enum JexlOperator
- All Implemented Interfaces:
- Serializable,- Comparable<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
- 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.
- Since:
- 3.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceUberspect that solves and evaluates JexlOperator overloads.
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionAdd operator.Bitwise-and operator.Array get operator as in: x[y].Array set operator as in: x[y] = z.Deprecated.3.5.0Compare overload as in compare(x, y).Complement operator.Test condition in if, for, while.Contains operator.Decrement pseudo-operator.Prefix --, decrements and returns the value after decrementing.Divide operator.Empty operator.Ends-with operator.Equals operator.Equal-strict operator.Iterator generator as in for(var x : y).Postfix --, decrements and returns the value before decrementing.Postfix ++, increments and returns the value before incrementing.Greater-than operator.Greater-than-or-equal operator.Increment pseudo-operator.Prefix ++ operator, increments and returns the value after incrementing.Less-than operator.Less-than-or-equal operator.Modulo operator.Multiply operator.Negate operator.Not operator.Not-Contains operator.Not-Ends-With operator.Not-Starts-With operator.Bitwise-or operator.Positivize operator.Property get operator as in: x.y.Property set operator as in: x.y = z.Self-add operator.Self-and operator.Self-divide operator.Self-modulo operator.Self-multiply operator.Self-or operator.Self-left-shift operator.Self-right-shift operator.Self-right-shift unsigned operator.Self-subtract operator.Self-xor operator.Bit-pattern left-shift operator.Bit-pattern right-shift operator.Bit-pattern right-shift unsigned operator.Size operator.Starts-with operator.Subtract operator.Bitwise-xor operator.
- 
Method SummaryModifier and TypeMethodDescriptionintgetArity()Gets this operator number of parameters.final JexlOperatorGets the base operator.final StringGets this operator method name in a JexlArithmetic.final StringGets this operator symbol.static JexlOperatorReturns the enum constant of this type with the specified name.static JexlOperator[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
ADDAdd operator.
 Syntax:x + y
 Method:T add(L x, R y);.- See Also:
 
- 
SUBTRACTSubtract operator.
 Syntax:x - y
 Method:T subtract(L x, R y);.- See Also:
 
- 
MULTIPLYMultiply operator.
 Syntax:x * y
 Method:T multiply(L x, R y);.- See Also:
 
- 
DIVIDEDivide operator.
 Syntax:x / y
 Method:T divide(L x, R y);.- See Also:
 
- 
MODModulo operator.
 Syntax:x % y
 Method:T mod(L x, R y);.- See Also:
 
- 
ANDBitwise-and operator.
 Syntax:x & y
 Method:T and(L x, R y);.- See Also:
 
- 
ORBitwise-or operator.
 Syntax:x | y
 Method:T or(L x, R y);.- See Also:
 
- 
XORBitwise-xor operator.
 Syntax:x ^ y
 Method:T xor(L x, R y);.- See Also:
 
- 
SHIFTRIGHTBit-pattern right-shift operator.
 Syntax:x >> y
 Method:T rightShift(L x, R y);.- See Also:
 
- 
SHIFTRIGHTUBit-pattern right-shift unsigned operator.
 Syntax:x >>> y
 Method:T rightShiftUnsigned(L x, R y);.- See Also:
 
- 
SHIFTLEFTBit-pattern left-shift operator.
 Syntax:x << y
 Method:T leftShift(L x, R y);.- See Also:
 
- 
EQEquals operator.
 Syntax:x == y
 Method:boolean equals(L x, R y);.- See Also:
 
- 
EQSTRICTEqual-strict operator.
 Syntax:x === y
 Method:boolean strictEquals(L x, R y);.- See Also:
 
- 
LTLess-than operator.
 Syntax:x < y
 Method:boolean lessThan(L x, R y);.- See Also:
 
- 
LTELess-than-or-equal operator.
 Syntax:x <= y
 Method:boolean lessThanOrEqual(L x, R y);.- See Also:
 
- 
GTGreater-than operator.
 Syntax:x > y
 Method:boolean greaterThan(L x, R y);.- See Also:
 
- 
GTEGreater-than-or-equal operator.
 Syntax:x >= y
 Method:boolean greaterThanOrEqual(L x, R y);.- See Also:
 
- 
CONTAINSContains operator.
 Syntax:x =~ y
 Method:boolean contains(L x, R y);.- See Also:
 
- 
STARTSWITHStarts-with operator.
 Syntax:x =^ y
 Method:boolean startsWith(L x, R y);.- See Also:
 
- 
ENDSWITHEnds-with operator.
 Syntax:x =$ y
 Method:boolean endsWith(L x, R y);.- See Also:
 
- 
NOTNot operator.
 Syntax:!x
 Method:T not(L x);.- See Also:
 
- 
COMPLEMENTComplement operator.
 Syntax:~x
 Method:T complement(L x);.- See Also:
 
- 
NEGATENegate operator.
 Syntax:-x
 Method:T negate(L x);.- See Also:
 
- 
POSITIVIZEPositivize operator.
 Syntax:+x
 Method:T positivize(L x);.- See Also:
 
- 
EMPTYEmpty operator.
 Syntax:empty xorempty(x)
 Method:boolean empty(L x);.- See Also:
 
- 
SIZESize operator.
 Syntax:size xorsize(x)
 Method:int size(L x);.- See Also:
 
- 
SELF_ADDSelf-add operator.
 Syntax:x += y
 Method:T selfAdd(L x, R y);.
- 
SELF_SUBTRACTSelf-subtract operator.
 Syntax:x -= y
 Method:T selfSubtract(L x, R y);.
- 
SELF_MULTIPLYSelf-multiply operator.
 Syntax:x *= y
 Method:T selfMultiply(L x, R y);.
- 
SELF_DIVIDESelf-divide operator.
 Syntax:x /= y
 Method:T selfDivide(L x, R y);.
- 
SELF_MODSelf-modulo operator.
 Syntax:x %= y
 Method:T selfMod(L x, R y);.
- 
SELF_ANDSelf-and operator.
 Syntax:x &= y
 Method:T selfAnd(L x, R y);.
- 
SELF_ORSelf-or operator.
 Syntax:x |= y
 Method:T selfOr(L x, R y);.
- 
SELF_XORSelf-xor operator.
 Syntax:x ^= y
 Method:T selfXor(L x, R y);.
- 
SELF_SHIFTRIGHTSelf-right-shift operator.
 Syntax:x >>= y
 Method:T selfShiftRight(L x, R y);.
- 
SELF_SHIFTRIGHTUSelf-right-shift unsigned operator.
 Syntax:x >>> y
 Method:T selfShiftRightUnsigned(L x, R y);.
- 
SELF_SHIFTLEFTSelf-left-shift operator.
 Syntax:x << y
 Method:T selfShiftLeft(L x, R y);.
- 
INCREMENTIncrement pseudo-operator.
 No syntax, used as helper for the prefix and postfix versions of++.- See Also:
 
- 
DECREMENTDecrement pseudo-operator.
 No syntax, used as helper for the prefix and postfix versions of--.- See Also:
 
- 
INCREMENT_AND_GETPrefix ++ operator, increments and returns the value after incrementing.
 Syntax:++x
 Method:T incrementAndGet(L x);.
- 
GET_AND_INCREMENTPostfix ++, increments and returns the value before incrementing.
 Syntax:x++
 Method:T getAndIncrement(L x);.
- 
DECREMENT_AND_GETPrefix --, decrements and returns the value after decrementing.
 Syntax:--x
 Method:T decrementAndGet(L x);.
- 
GET_AND_DECREMENTPostfix --, decrements and returns the value before decrementing.
 Syntax:x--
 Method:T getAndDecrement(L x);.
- 
ASSIGNDeprecated.3.5.0Marker for side effect.
 Returns this from 'self*' overload method to let the engine know the side effect has been performed and there is no need to assign the result.
- 
PROPERTY_GETProperty get operator as in: x.y.
 Syntax:x.y
 Method:Object propertyGet(L x, R y);.
- 
PROPERTY_SETProperty set operator as in: x.y = z.
 Syntax:x.y = z
 Method:void propertySet(L x, R y, V z);.
- 
ARRAY_GETArray get operator as in: x[y].
 Syntax:x.y
 Method:Object arrayGet(L x, R y);.
- 
ARRAY_SETArray set operator as in: x[y] = z.
 Syntax:x[y] = z
 Method:void arraySet(L x, R y, V z);.
- 
FOR_EACHIterator generator as in for(var x : y). If the returned Iterator is AutoCloseable, close will be called after the last execution of the loop block.
 Syntax:for(var x : y){...}
 Method:Iterator<Object> forEach(R y);.- Since:
- 3.1
 
- 
CONDITIONTest condition in if, for, while.
 Method:boolean testCondition(R y);.- Since:
- 3.3
 
- 
COMPARECompare overload as in compare(x, y).
 Method:boolean compare(L x, R y);.- Since:
- 3.5.0
 
- 
NOT_CONTAINSNot-Contains operator.Not overridable, calls !(contain(...)) 
- 
NOT_STARTSWITHNot-Starts-With operator.Not overridable, calls !(startsWith(...)) 
- 
NOT_ENDSWITHNot-Ends-With operator.Not overridable, calls !(endsWith(...)) 
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
getArityGets this operator number of parameters.- Returns:
- the method arity
 
- 
getBaseOperatorGets the base operator.- Returns:
- the base operator
 
- 
getMethodNameGets this operator method name in a JexlArithmetic.- Returns:
- the method name
 
- 
getOperatorSymbolGets this operator symbol.- Returns:
- the symbol
 
 
-