org.apache.velocity.runtime.directive
public class Foreach extends Directive
Modifier and Type | Class and Description |
---|---|
protected static class |
Foreach.NullHolderContext
A special context to use when the foreach iterator returns a null.
|
Modifier and Type | Field and Description |
---|---|
protected Info |
uberInfo
immutable, so create in init
|
BLOCK, LINE
Constructor and Description |
---|
Foreach() |
Modifier and Type | Method and Description |
---|---|
protected void |
clean(InternalContextAdapter context,
java.lang.Object o,
java.lang.Object savedCounter,
java.lang.Object nextFlag) |
java.lang.String |
getName()
Return name of this directive.
|
int |
getType()
Return type of this directive.
|
void |
init(RuntimeServices rs,
InternalContextAdapter context,
Node node)
simple init - init the tree and get the elementKey from
the AST
|
protected void |
put(InternalContextAdapter context,
java.lang.String key,
java.lang.Object value)
Extension hook to allow subclasses to control whether loop vars
are set locally or not.
|
boolean |
render(InternalContextAdapter context,
java.io.Writer writer,
Node node)
renders the #foreach() block
|
getColumn, getLine, getScopeName, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
protected Info uberInfo
public java.lang.String getName()
public int getType()
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException
init
in class Directive
rs
- context
- node
- TemplateInitException
protected void put(InternalContextAdapter context, java.lang.String key, java.lang.Object value)
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException
render
in class Directive
context
- writer
- node
- java.io.IOException
MethodInvocationException
ResourceNotFoundException
ParseErrorException
protected void clean(InternalContextAdapter context, java.lang.Object o, java.lang.Object savedCounter, java.lang.Object nextFlag)
Copyright © 2000-2014. All Rights Reserved.