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 classAdapts an array to an Iterableprivate classAdapts an Enumeration to an Iterablestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BodyNodeprivate final BodyNodeprivate final Expression<?> private final String -
Constructor Summary
ConstructorsConstructorDescriptionForNode(int lineNumber, String variableName, Expression<?> iterableExpression, BodyNode body, BodyNode elseBody) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(NodeVisitor visitor) getBody()Expression<?> voidrender(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:
renderin interfaceRenderableNode- Specified by:
renderin classAbstractRenderableNode- Throws:
IOException
-
accept
- Specified by:
acceptin interfaceNode- Specified by:
acceptin classAbstractRenderableNode
-
getIterationVariable
-
getIterable
-
getBody
-
getElseBody
-
toIterable
-