Package io.pebbletemplates.pebble.node
Class ForNode
java.lang.Object
io.pebbletemplates.pebble.node.AbstractRenderableNode
io.pebbletemplates.pebble.node.ForNode
- All Implemented Interfaces:
Node
,RenderableNode
Represents a "for" loop within the template.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Adapts an array to an Iterableprivate class
Adapts an Enumeration to an Iterablestatic class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BodyNode
private final BodyNode
private final Expression
<?> private final String
-
Constructor Summary
ConstructorsConstructorDescriptionForNode
(int lineNumber, String variableName, Expression<?> iterableExpression, BodyNode body, BodyNode elseBody) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(NodeVisitor visitor) getBody()
Expression
<?> void
render
(PebbleTemplateImpl self, Writer writer, EvaluationContextImpl context) toIterable
(Object obj) Methods inherited from class io.pebbletemplates.pebble.node.AbstractRenderableNode
getLineNumber, setLineNumber
-
Field Details
-
variableName
-
iterableExpression
-
body
-
elseBody
-
-
Constructor Details
-
ForNode
public ForNode(int lineNumber, String variableName, Expression<?> iterableExpression, BodyNode body, BodyNode elseBody)
-
-
Method Details
-
render
public void render(PebbleTemplateImpl self, Writer writer, EvaluationContextImpl context) throws IOException - Specified by:
render
in interfaceRenderableNode
- Specified by:
render
in classAbstractRenderableNode
- Throws:
IOException
-
accept
- Specified by:
accept
in interfaceNode
- Specified by:
accept
in classAbstractRenderableNode
-
getIterationVariable
-
getIterable
-
getBody
-
getElseBody
-
toIterable
-