|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.szegedi.expose.model.ReflectionObjectModelBase
|
+--org.szegedi.expose.model.ReflectionObjectModel
|
+--org.szegedi.expose.model.ReflectionIteratorModel
A class that adds TemplateListModel functionality to the
Iterator interface implementers.
Using the model as a list model is NOT thread-safe, as iterators are
inherently not thread-safe.
| Fields inherited from class org.szegedi.expose.model.ReflectionObjectModelBase |
TYPE_ARRAY, TYPE_COLLECTION, TYPE_ENUMERATION, TYPE_ITERATOR, TYPE_MAP, TYPE_OBJECT, TYPE_OBJECT_BASE, TYPE_RESOURCE_BUNDLE |
| Constructor Summary | |
ReflectionIteratorModel(java.util.Iterator iterator)
Creates a new model that wraps the specified iterator object. |
|
| Method Summary | |
freemarker.template.TemplateModel |
get(int index)
Throws an UnsupportedOperationException as iterator elements can not be accessed at random. |
static ReflectionIteratorModel |
getInstance(java.util.Iterator object)
Returns a model wrapping the specified iterator object. |
int |
getType()
Returns the type of this object (which is TYPE_ITERATOR) |
boolean |
hasNext()
Calls Iterator.hasNext(). |
boolean |
isEmpty()
Returns iterator == null || ! |
boolean |
isRewound()
True if the iterator's next method has not been called since last rewind, or since the object creation. |
freemarker.template.TemplateModel |
listSize()
Throws an UnsupportedOperationException as iterator size is unknown |
freemarker.template.TemplateModel |
next()
Calls Iterator.next(). |
void |
rewind()
If the iterator is a ListIterator, rewinds it to the first position. |
| Methods inherited from class org.szegedi.expose.model.ReflectionObjectModel |
get, getInstance |
| Methods inherited from class org.szegedi.expose.model.ReflectionObjectModelBase |
getAsString, getInstance, getObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ReflectionIteratorModel(java.util.Iterator iterator)
object - the iterator object to wrap into a model.| Method Detail |
public static final ReflectionIteratorModel getInstance(java.util.Iterator object)
WeakReference objects. The caching can be turned
off by setting the expose.reflection.nocache system property to
true. In this case calling this method is equivalent to constructing a new model.object - the iterator to wrap into a model.public int getType()
getType in class ReflectionObjectModelpublic boolean hasNext()
Iterator.hasNext().hasNext in interface freemarker.template.TemplateListModelpublic boolean isRewound()
isRewound in interface freemarker.template.TemplateListModelpublic freemarker.template.TemplateModel next()
Iterator.next().next in interface freemarker.template.TemplateListModel
public void rewind()
throws freemarker.template.TemplateModelException
ListIterator, rewinds it to the first position.rewind in interface freemarker.template.TemplateListModelfreemarker.template.TemplateModelException - if the iterator is not a list iterator (and thus
cannot be rewound).public boolean isEmpty()
isEmpty in interface freemarker.template.TemplateModelisEmpty in class ReflectionObjectModelBasepublic freemarker.template.TemplateModel listSize()
public freemarker.template.TemplateModel get(int index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||