org.apache.velocity.runtime.directive
public class Foreach extends Directive
Modifier and Type | Field and Description |
---|---|
private int |
counterInitialValue
What value to start the loop counter at.
|
private java.lang.String |
counterName
The name of the variable to use when placing
the counter value into the context.
|
private java.lang.String |
elementKey
The reference name used to access each
of the elements in the list object.
|
protected Info |
uberInfo
immutable, so create in init
|
BLOCK, LINE
Constructor and Description |
---|
Foreach() |
Modifier and Type | Method and Description |
---|---|
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
|
boolean |
render(InternalContextAdapter context,
java.io.Writer writer,
Node node)
renders the #foreach() block
|
getColumn, getLine, setLocation
private java.lang.String counterName
private int counterInitialValue
private java.lang.String elementKey
protected Info uberInfo
public java.lang.String getName()
public int getType()
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws java.lang.Exception
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException
render
in class Directive
java.io.IOException
MethodInvocationException
ResourceNotFoundException
ParseErrorException
Copyright ? 2002 Apache Software Foundation. All Rights Reserved.