freemarker.template
Interface TemplateSequenceModel
- All Superinterfaces:
- TemplateModel
- All Known Implementing Classes:
- ArrayModel, CollectionAndSequence, CollectionModel, JythonSequenceModel, NodeListModel, NodeListModel, NodeModel, SimpleSequence, StringArraySequence, TemplateModelListSequence
- public interface TemplateSequenceModel
- extends TemplateModel
List values in a template data model whose elements are accessed by the
index operator should implement this interface. In addition to
accessing elements by index and querying size using the ?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.
- Version:
- $Id: TemplateSequenceModel.java,v 1.8 2003/01/12 23:40:21 revusky Exp $
- Author:
- Attila Szegedi, szegedia at users dot sourceforge dot net
Method Summary |
TemplateModel |
get(int index)
Retrieves the i-th template model in this sequence. |
int |
size()
|
get
public TemplateModel get(int index)
throws TemplateModelException
- Retrieves the i-th template model in this sequence.
- Throws:
TemplateModelException
size
public int size()
throws TemplateModelException
- Returns:
- the number of items in the list.
- Throws:
TemplateModelException