public final class CollectionAndSequence extends java.lang.Object implements TemplateCollectionModel, TemplateSequenceModel, java.io.Serializable
NOTHING| Constructor and Description |
|---|
CollectionAndSequence(TemplateCollectionModel collection) |
CollectionAndSequence(TemplateSequenceModel sequence) |
| Modifier and Type | Method and Description |
|---|---|
TemplateModel |
get(int i)
Retrieves the i-th template model in this sequence.
|
TemplateModelIterator |
iterator()
Retrieves a template model iterator that is used to iterate over
the elements in this collection.
|
int |
size() |
public CollectionAndSequence(TemplateCollectionModel collection)
public CollectionAndSequence(TemplateSequenceModel sequence)
public TemplateModelIterator iterator() throws TemplateModelException
TemplateCollectionModeliterator in interface TemplateCollectionModelTemplateModelExceptionpublic TemplateModel get(int i) throws TemplateModelException
TemplateSequenceModelget in interface TemplateSequenceModelnull 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.TemplateModelExceptionpublic int size()
throws TemplateModelException
size in interface TemplateSequenceModelTemplateModelException