freemarker.template
public interface TemplateSequenceModel extends TemplateModel
?size
built-in, objects that implement this interface can be iterated in
<#foreach ...>
and <#list ...>
directives. The
iteration is implemented by calling the get(int)
method
repeatedly starting from zero and going to size()
- 1.NOTHING
Modifier and Type | Method and Description |
---|---|
TemplateModel |
get(int index)
Retrieves the i-th template model in this sequence.
|
int |
size() |
TemplateModel get(int index) throws TemplateModelException
null
if
the index is out of bounds. Note that a null
value is
interpreted by FreeMarker as "variable does not exist", and accessing
a missing variables is usually considered as an error in the FreeMarker
Template Language, so the usage of a bad index will not remain hidden.TemplateModelException
int size() throws TemplateModelException
TemplateModelException