Class OpFunctions
java.lang.Object
org.apache.juneau.commons.svl.functions.OpFunctions
Reserved
$op.* operator functions targeted by the compiled expression grammar.
Each operator is one VarFunction registered only under its reserved $op. name (never
under a plain name). All are deniable via an allowlist like any other function. Arguments arrive already
evaluated; short-circuiting (and, or, elvis, ternary) is the evaluator's job.
Coercion rules (SpEL-style):
- Numeric tower:
Byte/Short/Integer/Longstaylong(overflow detected withMath.*Exactand promoted toBigDecimal); anyDouble/Floatoperand givesdouble(this wins overBigDecimal); otherwise anyBigDecimal/BigIntegergivesBigDecimal. addconcatenates when either operand is aString; anulloperand renders as"null".sub/mul/div/mod/neg/posare numeric only.divof two integral values stays integral only when exact, otherwisedouble. Integral (and BigDecimal) division or modulo by zero is an error; by0.0follows IEEE 754.eq/necompare numbers numerically (1 == 1.0), otherwiseObjects.equals(java.lang.Object, java.lang.Object).lt/le/gt/gecompare numbers numerically or same-classComparables; anything else is an error. Anulloperand is an error in strict mode andfalsein lenient mode.and/or/not/ternaryacceptBooleanor the strings"true"/"false", matched case-insensitively (consistent withBooleanFunctions, whose parser also uses case-insensitive matching but additionally accepts 1/yes/on and 0/no/off, which operators deliberately do not).andandorvalidate both operands before combining.Long.MIN_VALUE / -1overflows and is promoted toBigDecimal;Long.MIN_VALUE % -1is0.- NaN is unordered:
eqis false,netrue, and all relational operators false.0.0 == -0.0. Long-versus-double comparison is exact (no precision loss). addstring concatenation renders doubles viaArithmeticFunctions.render(double)(integral values drop.0) and BigDecimal viatoPlainString().elvisis null-only:false,0and""are kept.matchesuses a bounded shared pattern cache. There is no match timeout: ReDoS exposure is bounded only by the configured limits and the function allowlist.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class$op.add.static class$op.and.static class$op.div.static class$op.elvis.static class$op.eq.static class$op.ge.static class$op.gt.static class$op.le.static class$op.lt.static class$op.matches.static class$op.mod.static class$op.mul.static class$op.ne.static class$op.neg.static class$op.not.static class$op.or.static class$op.pos.static classRegistered stub for the evaluator-only$op.projectoperator.static classRegistered stub for the evaluator-only$op.selectoperator.static class$op.sub.static class$op.ternary. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<? extends VarFunction>[]All function classes in this category. -
Method Summary
-
Field Details
-
ALL
All function classes in this category.
-