|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.beans2.IndexedPropertyWrapper
public class IndexedPropertyWrapper
Wrapper for an indexed property of a JavaBean.
Constructor Summary | |
---|---|
IndexedPropertyWrapper(java.lang.Object object,
java.beans.IndexedPropertyDescriptor ipd)
Constructor that takes an indexed property descriptor and a target object on which it will be invoked. |
Method Summary | |
---|---|
TemplateModel |
get(java.lang.String key)
Gets a TemplateModel from the hash. |
java.lang.Object |
getAsObject()
Return the underlying object to the reflection mechanism. |
TemplateModel |
getAtIndex(long index)
Get the value corresponding to the given index. |
boolean |
isEmpty()
Is the object empty? |
void |
putAtIndex(long index,
TemplateModel model)
Set the value corresponding to the given index. |
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexedPropertyWrapper(java.lang.Object object, java.beans.IndexedPropertyDescriptor ipd)
object
- the object on which the indexed property will be calledipd
- the descriptor for the indexed propertyMethod Detail |
---|
public boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public TemplateModel getAtIndex(long index) throws TemplateModelException
TemplateIndexedModel
java.util.Vector
.
getAtIndex
in interface TemplateIndexedModel
index
- the index of the underlying value we're interested in
TemplateModel
representing the value for the given index
TemplateModelException
- the value could not be determined, possibly
due to an index out-of-bounds, or an otherwise undefined valuepublic void putAtIndex(long index, TemplateModel model) throws TemplateModelException
TemplateWriteableIndexedModel
java.util.Vector
.
putAtIndex
in interface TemplateWriteableIndexedModel
index
- the index of the underlying value we're interested inmodel
- the TemplateModel
to be added to the list
for the given index
TemplateModelException
- the value could not be set, possibly
due to an index out-of-bounds, or some other errorpublic TemplateIteratorModel templateIterator() throws TemplateModelException
TemplateListModel2
null
if there are no elements in the list.
templateIterator
in interface TemplateListModel2
TemplateModelException
- the next item in the list can't be
retrieved, or no next item exists.public void releaseIterator(TemplateIteratorModel iterator)
TemplateListModel2
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 TemplateListModel2.templateIterator()
is
null
, this method will not be called for the
null
iterator.
releaseIterator
in interface TemplateListModel2
iterator
- the iterator to be returned to the object pool, if anypublic TemplateModel get(java.lang.String key) throws TemplateModelException
TemplateModel
from the hash.
get
in interface TemplateHashModel
key
- the name by which the TemplateModel
is identified in the template.
TemplateModel
referred to by the key,
or null
if not found.
TemplateModelException
- there was a problem getting the value
for the given keypublic java.lang.Object getAsObject() throws TemplateModelException
getAsObject
in interface TemplateObjectModel
TemplateModelException
- the object could not be returned
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |