Class TemplateEngine.CompositeExpression
java.lang.Object
org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
org.apache.commons.jexl3.internal.TemplateEngine.CompositeExpression
- All Implemented Interfaces:
JxltEngine.Expression
- Enclosing class:
TemplateEngine
A composite unified expression: "... ${...} ... #{...} ...".
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TemplateEngine.TemplateExpression[]The list of sub-expression resulting from parsing.private final intBit encoded (deferred count > 0) bit 1, (immediate count > 0) bit 0.Fields inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
source -
Constructor Summary
ConstructorsConstructorDescriptionCompositeExpression(int[] counters, List<TemplateEngine.TemplateExpression> list, TemplateEngine.TemplateExpression src) Creates a composite 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) TemplateEngine.ExpressionTypegetType()Gets this TemplateExpression type.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.booleanChecks whether this expression is immediate.protected TemplateEngine.TemplateExpressionprepare(Interpreter interpreter) Prepares a sub-expression for interpretation.
-
Field Details
-
meta
private final int metaBit encoded (deferred count > 0) bit 1, (immediate count > 0) bit 0. -
exprs
The list of sub-expression resulting from parsing.
-
-
Constructor Details
-
CompositeExpression
CompositeExpression(int[] counters, List<TemplateEngine.TemplateExpression> list, TemplateEngine.TemplateExpression src) Creates a composite expression.- Parameters:
counters- counters of expressions per typelist- the sub-expressionssrc- the source for this 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
-
getType
TemplateEngine.ExpressionType getType()Description copied from class:TemplateEngine.TemplateExpressionGets this TemplateExpression type.- Specified by:
getTypein classTemplateEngine.TemplateExpression- Returns:
- its type
-
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
Fills up the list of variables accessed by this unified expression.- Overrides:
getVariablesin classTemplateEngine.TemplateExpression- Parameters:
collector- the variable collector
-
isImmediate
public boolean isImmediate()Description copied from interface:JxltEngine.ExpressionChecks whether this expression is immediate.- Specified by:
isImmediatein interfaceJxltEngine.Expression- Overrides:
isImmediatein classTemplateEngine.TemplateExpression- Returns:
- true if immediate, false otherwise
-
prepare
Description copied from class:TemplateEngine.TemplateExpressionPrepares a sub-expression for interpretation.- Overrides:
preparein classTemplateEngine.TemplateExpression- Parameters:
interpreter- a JEXL interpreter- Returns:
- a prepared unified expression
-