Creates and evaluates Expression and Script objects. Determines the behavior of Expressions & Scripts during their evaluation with respect to:
The setSilent
and setLenient
methods allow to fine-tune an engine instance behavior according to various error control needs. The lenient/strict flag tells the engine when and if null as operand is considered an error, the silent/verbose flag tells the engine what to do with the error (log as warning or throw exception).
0 & null should be indicators of "default" values so that even in an case of error, something meaningfull can still be inferred; may be convenient for configurations.
One should probably consider using null as an error case - ie, every object manipulated by JEXL should be valued; the ternary operator, especially the '?:' form can be used to workaround exceptional cases. Use case could be configuration with no implicit values or defaults.
The error control grain is roughly on par with JEXL 1.0
The finest error control grain is obtained; it is the closest to Java code - still augmented by "script" capabilities regarding automated conversions & type matching.
Note that methods that evaluate expressions may throw unchecked exceptions; The {@link JexlException} are thrown in "non-silent" mode but since these areRuntimeException, user-code should catch them wherever most appropriate.
@since 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|