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 CharSequenceThe JEXL string for this unified expression.protected final JexlNodeThe JEXL node for this unified expression.Fields inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
source -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJexlBasedExpression(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 Objectevaluate(Interpreter interpreter) Interprets a sub-expression.(package private) JexlInfogetInfo()Gets the list of variables accessed by this expression.protected voidgetVariables(Engine.VarCollector collector) Fills up the list of variables accessed by this unified expression.protected JexlOptionsoptions(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.ExpressionAdds this expression's string representation to a StringBuilder.- Parameters:
strb- the builder to fill- Returns:
- the builder argument
-
evaluate
Description copied from class:TemplateEngine.TemplateExpressionInterprets a sub-expression.- Specified by:
evaluatein classTemplateEngine.TemplateExpression- Parameters:
interpreter- a JEXL interpreter- Returns:
- the result of interpretation
-
getInfo
JexlInfo getInfo()- Overrides:
getInfoin classTemplateEngine.TemplateExpression- Returns:
- the info
-
getVariables
Description copied from interface:JxltEngine.ExpressionGets 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:
getVariablesin interfaceJxltEngine.Expression- Overrides:
getVariablesin 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.TemplateExpressionFills up the list of variables accessed by this unified expression.- Overrides:
getVariablesin classTemplateEngine.TemplateExpression- Parameters:
collector- the variable collector
-
options
Description copied from class:TemplateEngine.TemplateExpressionThe options to use during evaluation.- Overrides:
optionsin classTemplateEngine.TemplateExpression- Parameters:
context- the context- Returns:
- the options
-