|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemplateListModel2
List values in a template data model must implement either this interface
or the deprecated TemplateListModel
interface. This interface acts
effectively as a factory for TemplateIteratorModel
objects.
TemplateIteratorModel objects are the objects that actually iterate
over the underlying list represented by this interface. The relationship
is almost identical to that between java.util.List
implementations
and the java.util.Iterator
interface.
This interface also supports the notion of recycling iterators. This is not required, but may improve efficiency in cases where creating a new iterator is expensive.
This interface replaces the now deprecated TemplateListModel
interface.
The detail messages of any TemplateModelException
s
thrown will be included as HTML comments in the output.
TemplateListModel
,
TemplateIteratorModel
Method Summary | |
---|---|
void |
releaseIterator(TemplateIteratorModel iterator)
Returns the used iterator to the list model. |
TemplateIteratorModel |
templateIterator()
Retrieves an iterator to iterate over this list. |
Methods inherited from interface freemarker.template.TemplateModel |
---|
isEmpty |
Method Detail |
---|
TemplateIteratorModel templateIterator() throws TemplateModelException
null
if there are no elements in the list.
TemplateModelException
- the next item in the list can't be
retrieved, or no next item exists.void releaseIterator(TemplateIteratorModel iterator)
Returns the used iterator to the list model. Implement this method
when you want to use an object pool of TemplateIterator
objects.
Otherwise, leave the implementation of this method blank.
Note that if the iterator returned in templateIterator()
is
null
, this method will not be called for the
null
iterator.
iterator
- the iterator to be returned to the object pool, if any
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |