freemarker.ext.beans2
Class ListIteratorWrapper<T extends java.util.ListIterator>

java.lang.Object
  extended by freemarker.ext.beans2.BeanWrapper<T>
      extended by freemarker.ext.beans2.IteratorWrapper<T>
          extended by freemarker.ext.beans2.ListIteratorWrapper<T>
All Implemented Interfaces:
ObjectWrapper, TemplateHashModel, TemplateIteratorModel, TemplateModel, TemplateObjectModel, TemplateScalarModel, TemplateWriteableHashModel, TemplateWriteableIteratorModel, java.io.Serializable, java.lang.Cloneable

public class ListIteratorWrapper<T extends java.util.ListIterator>
extends IteratorWrapper<T>
implements TemplateWriteableIteratorModel, java.io.Serializable

Wraps a ListIterator object as an Iterator model. Also provides support for any additional methods provided by the list iterator.

Since:
1.9
Version:
$Id: ListIteratorWrapper.java 1067 2011-06-06 10:55:28Z run2000 $
Author:
Nicholas Cull
See Also:
Serialized Form

Field Summary
 
Fields inherited from class freemarker.ext.beans2.BeanWrapper
emptyParams, object
 
Constructor Summary
ListIteratorWrapper()
          Default constructor where an object is not provided initially.
ListIteratorWrapper(T iterator)
          Constructor that takes a ListIterator object to be wrapped.
 
Method Summary
 void set(TemplateModel model)
          Inserts the specified element into the list.
 
Methods inherited from class freemarker.ext.beans2.IteratorWrapper
hasNext, isEmpty, next
 
Methods inherited from class freemarker.ext.beans2.BeanWrapper
clone, get, getAsObject, getAsString, put, setObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemarker.template.TemplateIteratorModel
hasNext, next
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Constructor Detail

ListIteratorWrapper

public ListIteratorWrapper()
Default constructor where an object is not provided initially. This allows the wrapper to be used as a prototype.


ListIteratorWrapper

public ListIteratorWrapper(T iterator)
Constructor that takes a ListIterator object to be wrapped.

Parameters:
iterator - the list iterator object to be wrapped
Method Detail

set

public void set(TemplateModel model)
         throws TemplateModelException
Inserts the specified element into the list. The element is inserted immediately before the next element that would be returned by next, if any.

Specified by:
set in interface TemplateWriteableIteratorModel
Parameters:
model - the model to insert into the list
Throws:
TemplateModelException - the model could not be assigned to the list