Class TemplateEngine.ConstantExpression
java.lang.Object
org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
org.apache.commons.jexl3.internal.TemplateEngine.ConstantExpression
- All Implemented Interfaces:
JxltEngine.Expression
- Enclosing class:
TemplateEngine
A constant unified expression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectThe constant held by this unified expression.Fields inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
source -
Constructor Summary
ConstructorsConstructorDescriptionConstantExpression(Object val, TemplateEngine.TemplateExpression source) Creates a constant 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) TemplateEngine.ExpressionTypegetType()Gets this TemplateExpression type.Methods inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
asString, evaluate, evaluate, getInfo, getSource, getVariables, getVariables, isDeferred, isImmediate, options, prepare, prepare, prepare, toString
-
Field Details
-
value
The constant held by this unified expression.
-
-
Constructor Details
-
ConstantExpression
ConstantExpression(Object val, TemplateEngine.TemplateExpression source) Creates a constant unified expression.If the wrapped constant is a string, it is treated as a JEXL strings with respect to escaping.
- Parameters:
val- the constant valuesource- the source TemplateExpression 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
-