Class DirectiveNode.MacroCallNode
java.lang.Object
com.google.auto.value.processor.escapevelocity.Node
com.google.auto.value.processor.escapevelocity.DirectiveNode
com.google.auto.value.processor.escapevelocity.DirectiveNode.MacroCallNode
- Enclosing class:
DirectiveNode
A node in the parse tree representing a macro call. If the template contains a definition like
#macro (mymacro $x $y) ... #end
, then a call of that macro looks like
#mymacro (xvalue yvalue)
. The call is represented by an instance of this class. The
definition itself does not appear in the parse tree.
Evaluating a macro involves temporarily setting the parameter variables ($x $y
in
the example) to thunks representing the argument expressions, evaluating the macro body, and
restoring any previous values that the parameter variables had.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.auto.value.processor.escapevelocity.DirectiveNode
DirectiveNode.ForEachNode, DirectiveNode.IfNode, DirectiveNode.MacroCallNode, DirectiveNode.SetNode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Macro
private final String
private final com.google.common.collect.ImmutableList
<Node> Fields inherited from class com.google.auto.value.processor.escapevelocity.Node
lineNumber, resourceName
-
Constructor Summary
ConstructorsConstructorDescriptionMacroCallNode
(String resourceName, int lineNumber, String name, com.google.common.collect.ImmutableList<Node> argumentNodes) -
Method Summary
Modifier and TypeMethodDescription(package private) int
(package private) Object
evaluate
(EvaluationContext context) Returns the result of evaluating this node in the given context.(package private) String
name()
(package private) void
Methods inherited from class com.google.auto.value.processor.escapevelocity.Node
cons, emptyNode, evaluationException, evaluationException
-
Field Details
-
name
-
thunks
-
macro
-
-
Constructor Details
-
MacroCallNode
-
-
Method Details
-
name
String name() -
argumentCount
int argumentCount() -
setMacro
-
evaluate
Description copied from class:Node
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.
.
-