Class DirectiveNode.IfNode
- java.lang.Object
-
- com.google.auto.value.processor.escapevelocity.Node
-
- com.google.auto.value.processor.escapevelocity.DirectiveNode
-
- com.google.auto.value.processor.escapevelocity.DirectiveNode.IfNode
-
- Enclosing class:
- DirectiveNode
static class DirectiveNode.IfNode extends DirectiveNode
A node in the parse tree representing an#ifconstruct. All instances of this class have a true subtree and a false subtree. For a plain#if (cond) body #end, the false subtree will be empty. For#if (cond1) body1 #elseif (cond2) body2 #else body3 #end, the false subtree will contain a nestedIfNode, as if#else #ifhad been used instead of#elseif.
-
-
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
Fields Modifier and Type Field Description private ExpressionNodeconditionprivate NodefalsePartprivate NodetruePart-
Fields inherited from class com.google.auto.value.processor.escapevelocity.Node
lineNumber, resourceName
-
-
Constructor Summary
Constructors Constructor Description IfNode(java.lang.String resourceName, int lineNumber, ExpressionNode condition, Node trueNode, Node falseNode)
-
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
-
condition
private final ExpressionNode condition
-
truePart
private final Node truePart
-
falsePart
private final Node falsePart
-
-
Constructor Detail
-
IfNode
IfNode(java.lang.String resourceName, int lineNumber, ExpressionNode condition, Node trueNode, Node falseNode)
-
-
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..
-
-