Class DirectiveNode.ForEachNode
- java.lang.Object
-
- com.google.auto.value.processor.escapevelocity.Node
-
- com.google.auto.value.processor.escapevelocity.DirectiveNode
-
- com.google.auto.value.processor.escapevelocity.DirectiveNode.ForEachNode
-
- Enclosing class:
- DirectiveNode
static class DirectiveNode.ForEachNode extends DirectiveNode
A node in the parse tree representing a#foreachconstruct. While evaluating#foreach ($x in $things), {$code $x} will be set to each element of$thingsin turn. Once the loop completes,$xwill go back to whatever value it had before, which might be undefined. During loop execution, the variable$foreachis also defined. Velocity defines a number of properties in this variable, but here we only support$foreach.hasNext.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDirectiveNode.ForEachNode.ForEachVarThis class is the type of the variable$foreachthat is defined within#foreachloops.-
Nested classes/interfaces inherited from class com.google.auto.value.processor.escapevelocity.DirectiveNode
DirectiveNode.ForEachNode, DirectiveNode.IfNode, DirectiveNode.MacroCallNode, DirectiveNode.SetNode
-
-
Field Summary
Fields Modifier and Type Field Description private Nodebodyprivate ExpressionNodecollectionprivate java.lang.Stringvar-
Fields inherited from class com.google.auto.value.processor.escapevelocity.Node
lineNumber, resourceName
-
-
Constructor Summary
Constructors Constructor Description ForEachNode(java.lang.String resourceName, int lineNumber, java.lang.String var, ExpressionNode in, Node body)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Objectevaluate(EvaluationContext context)Returns the result of evaluating this node in the given context.-
Methods inherited from class com.google.auto.value.processor.escapevelocity.Node
cons, emptyNode, evaluationException, evaluationException
-
-
-
-
Field Detail
-
var
private final java.lang.String var
-
collection
private final ExpressionNode collection
-
body
private final Node body
-
-
Constructor Detail
-
ForEachNode
ForEachNode(java.lang.String resourceName, int lineNumber, java.lang.String var, ExpressionNode in, Node body)
-
-
Method Detail
-
evaluate
java.lang.Object evaluate(EvaluationContext context)
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..
-
-