class ConstantExpressionNode extends ExpressionNode
23
in
#set ($x = 23)
, and for literal text in templates. In the template...
abc#{if}($x == 5)def#{end}xyz
...each of the strings abc
, def
, xyz
is represented by an instance of
this class that evaluates to that string, and the value 5
is
represented by an instance of this class that evaluates to the integer 5.ExpressionNode.BinaryExpressionNode, ExpressionNode.NotExpressionNode
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
value |
lineNumber
Constructor and Description |
---|
ConstantExpressionNode(int lineNumber,
java.lang.Object value) |
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.Object |
evaluate(EvaluationContext context)
Returns the result of evaluating this node in the given context.
|
intValue, isDefinedAndTrue, isTrue
cons, emptyNode, evaluationException, evaluationException
ConstantExpressionNode(int lineNumber, java.lang.Object value)
java.lang.Object evaluate(EvaluationContext context)
Node
2 + 3
to 5 in order to set
$x
to 5 in #set ($x = 2 + 3)
. Or it may be used directly as part of the
template output, for example evaluating replacing name
by Fred
in
My name is $name.
.