public class For extends Foreach
Foreach
Modifier and Type | Field and Description |
---|---|
protected int |
counterInitialValue |
protected java.lang.String |
counterName |
BLOCK, LINE
Constructor and Description |
---|
For() |
Modifier and Type | Method and Description |
---|---|
void |
checkArgs(java.util.ArrayList<java.lang.Integer> argtypes,
Token t,
java.lang.String templateName)
We do not allow a word token in any other arg position except for the 2nd
since we are looking for the pattern #foreach($foo in $bar).
|
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
|
protected void |
renderBlock(InternalContextAdapter context,
java.io.Writer writer,
Node node) |
clean, getIterator, put
getColumn, getLine, getScopeName, getTemplate, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
protected java.lang.String counterName
protected int counterInitialValue
public java.lang.String getName()
Foreach
public int getType()
Foreach
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException
Foreach
init
in class Foreach
TemplateInitException
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException
Foreach
protected void renderBlock(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException
renderBlock
in class Foreach
java.io.IOException
public void checkArgs(java.util.ArrayList<java.lang.Integer> argtypes, Token t, java.lang.String templateName) throws ParseException
checkArgs
in class Foreach
argtypes
- type, Array of argument types of each argument to the directive
for example ParserTreeConstants.JJTWORDt
- token of directivetemplateName
- the name of the template this directive is referenced in.ParseException