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 Object
The 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 Object
evaluate
(Interpreter interpreter) Interprets a sub-expression.(package private) TemplateEngine.ExpressionType
getType()
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.Expression
Adds this expression's string representation to a StringBuilder.- Parameters:
strb
- the builder to fill- Returns:
- the builder argument
-
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
-
getType
TemplateEngine.ExpressionType getType()Description copied from class:TemplateEngine.TemplateExpression
Gets this TemplateExpression type.- Specified by:
getType
in classTemplateEngine.TemplateExpression
- Returns:
- its type
-