Class Node
java.lang.Object
com.google.auto.value.processor.escapevelocity.Node
- Direct Known Subclasses:
DirectiveNode
,ExpressionNode
,Node.Cons
,TokenNode
A node in the parse tree.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Node
Create a new parse tree node that is the concatenation of the given ones.(package private) static Node
Returns an empty node in the parse tree.(package private) abstract Object
evaluate
(EvaluationContext context) Returns the result of evaluating this node in the given context.(package private) EvaluationException
evaluationException
(String message) (package private) EvaluationException
evaluationException
(Throwable cause) private String
where()
-
Field Details
-
resourceName
-
lineNumber
final int lineNumber
-
-
Constructor Details
-
Node
Node(String resourceName, int lineNumber)
-
-
Method Details
-
evaluate
Returns the result of evaluating this node in the given context. This result may be used as part of a further operation, for example evaluating2 + 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 replacingname
byFred
inMy name is $name.
. -
where
-
evaluationException
-
evaluationException
-
emptyNode
Returns an empty node in the parse tree. This is used for example to represent the trivial "else" part of an#if
that does not have an explicit#else
. -
cons
static Node cons(String resourceName, int lineNumber, com.google.common.collect.ImmutableList<Node> nodes) Create a new parse tree node that is the concatenation of the given ones. Evaluating the new node produces the same string as evaluating each of the given nodes and concatenating the result.
-