Class TemplateEngine.JexlBasedExpression
java.lang.Object
org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
org.apache.commons.jexl3.internal.TemplateEngine.JexlBasedExpression
- All Implemented Interfaces:
JxltEngine.Expression
- Direct Known Subclasses:
TemplateEngine.DeferredExpression
,TemplateEngine.ImmediateExpression
,TemplateEngine.NestedExpression
- Enclosing class:
- TemplateEngine
The base for JEXL based unified expressions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CharSequence
The JEXL string for this unified expression.protected final JexlNode
The JEXL node for this unified expression.Fields inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
source
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JexlBasedExpression
(CharSequence theExpr, JexlNode theNode, TemplateEngine.TemplateExpression theSource) Creates a JEXL interpretable unified expression. -
Method Summary
Modifier and TypeMethodDescriptionasString
(StringBuilder strb) Adds this expression's string representation to a StringBuilder.protected Object
evaluate
(Interpreter interpreter) Interprets a sub-expression.(package private) JexlInfo
getInfo()
Gets the list of variables accessed by this expression.protected void
getVariables
(Engine.VarCollector collector) Fills up the list of variables accessed by this unified expression.protected JexlOptions
options
(JexlContext context) The options to use during evaluation.Methods inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
asString, evaluate, evaluate, getSource, getType, isDeferred, isImmediate, prepare, prepare, prepare, toString
-
Field Details
-
expr
The JEXL string for this unified expression. -
node
The JEXL node for this unified expression.
-
-
Constructor Details
-
JexlBasedExpression
protected JexlBasedExpression(CharSequence theExpr, JexlNode theNode, TemplateEngine.TemplateExpression theSource) Creates a JEXL interpretable unified expression.- Parameters:
theExpr
- the unified expression as a stringtheNode
- the unified expression as an ASTtheSource
- the source unified expression if any
-
-
Method Details
-
asString
Description copied from interface:JxltEngine.Expression
Adds this expression's string representation to a StringBuilder.- Parameters:
strb
- the builder to fill- Returns:
- the builder argument
-
options
Description copied from class:TemplateEngine.TemplateExpression
The options to use during evaluation.- Overrides:
options
in classTemplateEngine.TemplateExpression
- Parameters:
context
- the context- Returns:
- the options
-
evaluate
Description copied from class:TemplateEngine.TemplateExpression
Interprets a sub-expression.- Specified by:
evaluate
in classTemplateEngine.TemplateExpression
- Parameters:
interpreter
- a JEXL interpreter- Returns:
- the result of interpretation
-
getVariables
Description copied from interface:JxltEngine.Expression
Gets the list of variables accessed by this expression.This method will visit all nodes of the sub-expressions and extract all variables whether they are written in 'dot' or 'bracketed' notation. (a.b is equivalent to a['b']).
- Specified by:
getVariables
in interfaceJxltEngine.Expression
- Overrides:
getVariables
in classTemplateEngine.TemplateExpression
- Returns:
- the set of variables, each as a list of strings (ant-ish variables use more than 1 string) or the empty set if no variables are used
-
getVariables
Description copied from class:TemplateEngine.TemplateExpression
Fills up the list of variables accessed by this unified expression.- Overrides:
getVariables
in classTemplateEngine.TemplateExpression
- Parameters:
collector
- the variable collector
-
getInfo
JexlInfo getInfo()- Overrides:
getInfo
in classTemplateEngine.TemplateExpression
- Returns:
- the info
-