public enum JexlOperator extends Enum<JexlOperator>
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 operator methods:
Enum Constant and Description |
---|
ADD
Add operator.
|
AND
Bitwise-and operator.
|
ARRAY_GET
Array get operator as in: x[y].
|
ARRAY_SET
Array set operator as in: x[y] = z.
|
ASSIGN
Marker for side effect.
|
COMPLEMENT
Complement operator.
|
CONTAINS
Contains operator.
|
DIVIDE
Divide operator.
|
EMPTY
Empty operator.
|
ENDSWITH
Ends-with operator.
|
EQ
Equals operator.
|
FOR_EACH
Iterator generator as in for(var x : y).
|
GT
Greater-than operator.
|
GTE
Greater-than-or-equal operator.
|
LT
Less-than operator.
|
LTE
Less-than-or-equal operator.
|
MOD
Modulo operator.
|
MULTIPLY
Multiply operator.
|
NEGATE
Negate operator.
|
NOT
Not operator.
|
OR
Bitwise-or operator.
|
POSITIVIZE
Positivize operator.
|
PROPERTY_GET
Property get operator as in: x.y.
|
PROPERTY_SET
Property set operator as in: x.y = z.
|
SELF_ADD
Self-add operator.
|
SELF_AND
Self-and operator.
|
SELF_DIVIDE
Self-divide operator.
|
SELF_MOD
Self-modulo operator.
|
SELF_MULTIPLY
Self-multiply operator.
|
SELF_OR
Self-or operator.
|
SELF_SUBTRACT
Self-subtract operator.
|
SELF_XOR
Self-xor operator.
|
SIZE
Size operator.
|
STARTSWITH
Starts-with operator.
|
SUBTRACT
Subtract operator.
|
XOR
Bitwise-xor operator.
|
Modifier and Type | Method and Description |
---|---|
int |
getArity()
Gets this operator number of parameters.
|
JexlOperator |
getBaseOperator()
Gets the base operator.
|
String |
getMethodName()
Gets this operator method name in a JexlArithmetic.
|
String |
getOperatorSymbol()
Gets this operator symbol.
|
static JexlOperator |
valueOf(String name)
Returns 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.
|
public static final JexlOperator ADD
x + y
T add(L x, R y);
.public static final JexlOperator SUBTRACT
x - y
T subtract(L x, R y);
.public static final JexlOperator MULTIPLY
x * y
T multiply(L x, R y);
.public static final JexlOperator DIVIDE
x / y
T divide(L x, R y);
.public static final JexlOperator MOD
x % y
T mod(L x, R y);
.public static final JexlOperator AND
x & y
T and(L x, R y);
.public static final JexlOperator OR
x | y
T or(L x, R y);
.public static final JexlOperator XOR
x ^ y
T xor(L x, R y);
.public static final JexlOperator EQ
x == y
boolean equals(L x, R y);
.public static final JexlOperator LT
x < y
boolean lessThan(L x, R y);
.public static final JexlOperator LTE
x <= y
boolean lessThanOrEqual(L x, R y);
.public static final JexlOperator GT
x > y
boolean greaterThan(L x, R y);
.public static final JexlOperator GTE
x >= y
boolean greaterThanOrEqual(L x, R y);
.public static final JexlOperator CONTAINS
x =~ y
boolean contains(L x, R y);
.public static final JexlOperator STARTSWITH
x =^ y
boolean startsWith(L x, R y);
.public static final JexlOperator ENDSWITH
x =$ y
boolean endsWith(L x, R y);
.public static final JexlOperator NOT
!x
T not(L x);
.JexlArithmetic.not(java.lang.Object)
public static final JexlOperator COMPLEMENT
~x
T complement(L x);
.public static final JexlOperator NEGATE
-x
T negate(L x);
.JexlArithmetic.negate(java.lang.Object)
public static final JexlOperator POSITIVIZE
+x
T positivize(L x);
.public static final JexlOperator EMPTY
empty x
or empty(x)
boolean empty(L x);
.JexlArithmetic.empty(java.lang.Object)
public static final JexlOperator SIZE
size x
or size(x)
int size(L x);
.JexlArithmetic.size(java.lang.Object)
public static final JexlOperator SELF_ADD
x += y
T selfAdd(L x, R y);
.public static final JexlOperator SELF_SUBTRACT
x -= y
T selfSubtract(L x, R y);
.public static final JexlOperator SELF_MULTIPLY
x *= y
T selfMultiply(L x, R y);
.public static final JexlOperator SELF_DIVIDE
x /= y
T selfDivide(L x, R y);
.public static final JexlOperator SELF_MOD
x %= y
T selfMod(L x, R y);
.public static final JexlOperator SELF_AND
x &= y
T selfAnd(L x, R y);
.public static final JexlOperator SELF_OR
x |= y
T selfOr(L x, R y);
.public static final JexlOperator SELF_XOR
x ^= y
T selfXor(L x, R y);
.public static final JexlOperator ASSIGN
public static final JexlOperator PROPERTY_GET
x.y
Object propertyGet(L x, R y);
.public static final JexlOperator PROPERTY_SET
x.y = z
void propertySet(L x, R y, V z);
.public static final JexlOperator ARRAY_GET
x.y
Object arrayGet(L x, R y);
.public static final JexlOperator ARRAY_SET
x[y] = z
void arraySet(L x, R y, V z);
.public static final JexlOperator FOR_EACH
for(var x : y){...}
Iterator<Object> forEach(R y);
.public static JexlOperator[] values()
for (JexlOperator c : JexlOperator.values()) System.out.println(c);
public static JexlOperator valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final String getOperatorSymbol()
public final String getMethodName()
public int getArity()
public final JexlOperator getBaseOperator()
Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.