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
final class TemplateEngine.ConstantExpression extends TemplateEngine.TemplateExpression
A constant unified expression.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
value
The constant held by this unified expression.-
Fields inherited from class org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression
source
-
-
Constructor Summary
Constructors Constructor Description ConstantExpression(java.lang.Object val, TemplateEngine.TemplateExpression source)
Creates a constant unified expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
asString(java.lang.StringBuilder strb)
Adds this expression's string representation to a StringBuilder.protected java.lang.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
-
-
-
-
Constructor Detail
-
ConstantExpression
ConstantExpression(java.lang.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 Detail
-
asString
public java.lang.StringBuilder asString(java.lang.StringBuilder strb)
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
protected java.lang.Object evaluate(Interpreter interpreter)
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
-
-