|
|||||||||
| 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.ReflectionCollectionModel
A special case of ReflectionObjectModel that adds implementation
for TemplateListModel on collection objects.
Using the model as a list model is thread-safe, as it maintains an iterator
on a per-thread basis.
| 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 | |
ReflectionCollectionModel(java.util.Collection collection)
Creates a new model that wraps the specified collection object. |
|
| Method Summary | |
freemarker.template.TemplateModel |
get(int index)
If the contained collection is a list, returns its element by position, wrapped into appropriate template model. |
static ReflectionCollectionModel |
getInstance(java.util.Collection object)
Returns a model wrapping the specified collection object. |
int |
getType()
Returns the type of this object (which is TYPE_COLLECTION) |
boolean |
hasNext()
Calls Iterator.hasNext(). |
boolean |
isEmpty()
Returns true if the underlying collection contains no elements. |
boolean |
isRewound()
Always return false to force calling rewind. |
freemarker.template.TemplateModel |
listSize()
Returns a Simple scalar with a string containing the decimal representation of the array size. |
freemarker.template.TemplateModel |
next()
Calls Iterator.next(). |
void |
rewind()
Creates a new iterator on the collection that will be used to implement other TemplateListModel methods. |
| 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 ReflectionCollectionModel(java.util.Collection collection)
object - the collection object to wrap into a model.| Method Detail |
public static final ReflectionCollectionModel getInstance(java.util.Collection 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 collection 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.TemplateListModelpublic void rewind()
TemplateListModel methods.rewind in interface freemarker.template.TemplateListModelpublic freemarker.template.TemplateModel get(int index)
public freemarker.template.TemplateModel listSize()
public boolean isEmpty()
isEmpty in interface freemarker.template.TemplateModelisEmpty in class ReflectionObjectModelBase
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||