public class Foreach extends Directive
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
Foreach.NullHolderContext
A special context to use when the foreach iterator returns a null.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected Info |
uberInfo
immutable, so create in init
|
BLOCK, LINE| 构造器和说明 |
|---|
Foreach() |
| 限定符和类型 | 方法和说明 |
|---|---|
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, setLocationprotected Info uberInfo
public java.lang.String getName()
public int getType()
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException
init 在类中 Directivers - context - node - TemplateInitExceptionprotected 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 在类中 Directivecontext - writer - node - java.io.IOExceptionMethodInvocationExceptionResourceNotFoundExceptionParseErrorExceptionprotected void clean(InternalContextAdapter context, java.lang.Object o, java.lang.Object savedCounter, java.lang.Object nextFlag)