| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | JexlThreadedArithmetic.Features
Holds the threaded version of some arithmetic features. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ThreadLocal | FEATURES
Whether this JexlArithmetic instance behaves in strict or lenient mode for this thread. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | JexlThreadedArithmetic(boolean
whether this arithmetic is lenient or strict lenient, MathContext the math context instance to use for +,-,/,*,% operations on big decimals. bigdContext, int the scale used for big decimals. bigdScale)Creates a JexlThreadedArithmetic instance. |
| Modifier and Type | Method and Description |
|---|---|
| public MathContext | getMathContext()
Overrides org. |
| public int | getMathScale()
Overrides org. |
| public boolean | isLenient()
Overrides org. |
| public static void | setLenient(Boolean
true means no JexlException will occur, false allows them, null reverts to default behavior flag)Overrides the default behavior and sets whether this JexlArithmetic instance triggers errors during evaluation when null is used as an operand for the current thread. |
| public static void | |
| public static void |
| FEATURES | back to summary |
|---|---|
| pack-priv static final ThreadLocal<JexlThreadedArithmetic. Whether this JexlArithmetic instance behaves in strict or lenient mode for this thread. | |
| JexlThreadedArithmetic | back to summary |
|---|---|
| public JexlThreadedArithmetic(boolean lenient) Standard ctor.
| |
| JexlThreadedArithmetic | back to summary |
|---|---|
| public JexlThreadedArithmetic(boolean lenient, MathContext bigdContext, int bigdScale) Creates a JexlThreadedArithmetic instance.
| |
| getMathContext | back to summary |
|---|---|
| public MathContext getMathContext() Overrides org. Doc from org. The MathContext instance used for +,-,/,*,% operations on big decimals.
| |
| getMathScale | back to summary |
|---|---|
| public int getMathScale() Overrides org. Doc from org. The BigDecimal scale used for comparison and coercion operations.
| |
| isLenient | back to summary |
|---|---|
| public boolean isLenient() Overrides org. Doc from org. Checks whether this JexlArithmetic instance triggers errors during evaluation when null is used as an operand.
| |
| setLenient | back to summary |
|---|---|
| public static void setLenient(Boolean flag) Overrides the default behavior and sets whether this JexlArithmetic instance triggers errors during evaluation when null is used as an operand for the current thread. It is advised to protect calls by either calling JexlThreadedArithmetic.setLenient explicitly before evaluation or add a try/finally clause resetting the flag to avoid unexpected reuse of the lenient flag value through thread pools side-effects.
| |
| setMathContext | back to summary |
|---|---|
| public static void setMathContext(MathContext mc) Sets the math context. The goal and constraints are the same than for setLenient.
| |
| setMathScale | back to summary |
|---|---|
| public static void setMathScale(Integer scale) Sets the math scale. The goal and constraints are the same than for setLenient.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | lenient
Whether this JexlArithmetic instance behaves in strict or lenient mode. |
| private MathContext | mathContext
The big decimal math context. |
| private Integer | mathScale
The big decimal scale. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| lenient | back to summary |
|---|---|
| private Boolean lenient Whether this JexlArithmetic instance behaves in strict or lenient mode. | |
| mathContext | back to summary |
|---|---|
| private MathContext mathContext The big decimal math context. | |
| mathScale | back to summary |
|---|---|
| private Integer mathScale The big decimal scale. | |
| Features | back to summary |
|---|---|
| pack-priv Features() Default ctor. | |