static class ReferenceNode.IndexReferenceNode extends ReferenceNode
$x[0]
or
$x.foo[$i]
. Indexing is array indexing or calling the get
method of a list
or a map.ReferenceNode.IndexReferenceNode, ReferenceNode.MemberReferenceNode, ReferenceNode.MethodReferenceNode, ReferenceNode.PlainReferenceNode
ExpressionNode.BinaryExpressionNode, ExpressionNode.NotExpressionNode
Modifier and Type | Field and Description |
---|---|
(package private) ExpressionNode |
index |
(package private) ReferenceNode |
lhs |
lineNumber
Constructor and Description |
---|
IndexReferenceNode(ReferenceNode lhs,
ExpressionNode index) |
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.
|
invokeMethod, visibleMethod
intValue, isDefinedAndTrue, isTrue
cons, emptyNode, evaluationException, evaluationException
final ReferenceNode lhs
final ExpressionNode index
IndexReferenceNode(ReferenceNode lhs, ExpressionNode index)
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.
.