|
|||||||||
| 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.ReflectionEnumerationModel
A class that adds TemplateListModel functionality to the
Iterator interface implementers.
Using the model as a list model is NOT thread-safe, as the enumerations 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 | |
ReflectionEnumerationModel(java.util.Enumeration enumeration)
Creates a new model that wraps the specified enumeration object. |
|
| Method Summary | |
freemarker.template.TemplateModel |
get(int index)
Throws an UnsupportedOperationException as enumeration elements can not be accessed at random. |
static ReflectionEnumerationModel |
getInstance(java.util.Enumeration object)
Returns a model wrapping the specified enumeration object. |
int |
getType()
Returns the type of this object (which is TYPE_ENUMERATION) |
boolean |
hasNext()
Calls Iterator.hasNext(). |
boolean |
isEmpty()
Returns enumeration == 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 enumeration size is unknown |
freemarker.template.TemplateModel |
next()
Calls Iterator.next(). |
void |
rewind()
Throws an UnsupportedOperationException as enumeration cannot be rewound |
| 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 ReflectionEnumerationModel(java.util.Enumeration enumeration)
object - the enumeration object to wrap into a model.| Method Detail |
public static final ReflectionEnumerationModel getInstance(java.util.Enumeration 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 enumeration 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()
rewind in interface freemarker.template.TemplateListModelpublic freemarker.template.TemplateModel listSize()
public freemarker.template.TemplateModel get(int index)
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 | ||||||||