Class ReferenceNode.PlainReferenceNode
java.lang.Object
com.google.auto.value.processor.escapevelocity.Node
com.google.auto.value.processor.escapevelocity.ExpressionNode
com.google.auto.value.processor.escapevelocity.ReferenceNode
com.google.auto.value.processor.escapevelocity.ReferenceNode.PlainReferenceNode
- Enclosing class:
ReferenceNode
A node in the parse tree that is a plain reference such as
$x. This node may appear
inside a more complex reference like $x.foo.-
Nested Class Summary
Nested classes/interfaces inherited from class ReferenceNode
ReferenceNode.IndexReferenceNode, ReferenceNode.MemberReferenceNode, ReferenceNode.MethodReferenceNode, ReferenceNode.PlainReferenceNodeNested classes/interfaces inherited from class ExpressionNode
ExpressionNode.BinaryExpressionNode, ExpressionNode.NotExpressionNode -
Field Summary
FieldsFields inherited from class Node
lineNumber, resourceName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Objectevaluate(EvaluationContext context) Returns the result of evaluating this node in the given context.(package private) booleanisDefinedAndTrue(EvaluationContext context) True if this is a defined value and it evaluates to true.Methods inherited from class ReferenceNode
invokeMethod, visibleMethodMethods inherited from class ExpressionNode
intValue, isTrueMethods inherited from class Node
cons, emptyNode, evaluationException, evaluationException
-
Field Details
-
id
-
-
Constructor Details
-
PlainReferenceNode
-
-
Method Details
-
evaluate
Description copied from class:NodeReturns the result of evaluating this node in the given context. This result may be used as part of a further operation, for example evaluating2 + 3to 5 in order to set$xto 5 in#set ($x = 2 + 3). Or it may be used directly as part of the template output, for example evaluating replacingnamebyFredinMy name is $name.. -
isDefinedAndTrue
Description copied from class:ExpressionNodeTrue if this is a defined value and it evaluates to true. This is the same asExpressionNode.isTrue(EvaluationContext)except that it is allowed for this to be undefined variable, in which it evaluates to false. The method is overridden for plain references so that undefined is the same as false. The reason is to support Velocity's idiom#if ($var), where it is not an error if$varis undefined.- Overrides:
isDefinedAndTruein classExpressionNode
-