public class ExpressionFactory
extends java.lang.Object
An ExpressionFactory is a factory class that
creates and uses a JexlEngine to create JEXL
Expressions.
It passes through several items to the JEXL Engine, including "silent" and "lenient" flags, the JEXL parse cache size, and JEXL namespace function objects (including jAgg functionality).
As of 0.9.0, this class is no longer a singleton, to allow concurrent
ExcelTransformers to avoid contention by having their own
ExpressionFactories.
| Constructor | Description |
|---|---|
ExpressionFactory() |
Constructs a
ExpressionFactory. |
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.commons.jexl2.Expression |
createExpression(java.lang.String expression) |
Create a JEXL
Expression from a string. |
boolean |
isLenient() |
Returns the internal
JexlEngine's "lenient" flag. |
boolean |
isSilent() |
Returns the internal
JexlEngine's "silent" flag. |
void |
registerFuncs(java.lang.String namespace,
java.lang.Object funcsObject) |
Registers an object under the given namespace in the JEXL Engine.
|
void |
setCache(int size) |
Sets the size of the Expression cache to be used inside the JEXL Engine.
|
void |
setDebug(boolean debug) |
Passes the given "debug" flag on to the internal
JexlEngine. |
void |
setLenient(boolean lenient) |
Passes the given "lenient" flag on to the internal
JexlEngine. |
void |
setSilent(boolean silent) |
Passes the given "silent" flag on to the internal
JexlEngine. |
public ExpressionFactory()
ExpressionFactory. Initializes an internal
JexlEngine and initializes the functions map.public void setLenient(boolean lenient)
JexlEngine.lenient - Whether the internal JexlEngine should be
"lenient".public boolean isLenient()
JexlEngine's "lenient" flag.JexlEngine is currently
"lenient".public void setSilent(boolean silent)
JexlEngine.silent - Whether the internal JexlEngine should be
"silent".public boolean isSilent()
JexlEngine's "silent" flag.JexlEngine is currently
"silent".public void setCache(int size)
size - The size of the cache.public void setDebug(boolean debug)
JexlEngine.debug - Whether the internal JexlEngine should be
in "debug" mode.public void registerFuncs(java.lang.String namespace,
java.lang.Object funcsObject)
Class object.namespace - The namespace.funcsObject - An object (or a Class) containing the
methods to expose as JEXL Engine functions.java.lang.IllegalArgumentException - If the namespace has already been
registered.public org.apache.commons.jexl2.Expression createExpression(java.lang.String expression)
Expression from a string.expression - The expression as a String.Expression.Copyright © 2012–2018 Jett Team. All rights reserved.