|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.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 property| Method Detail |
|---|
public boolean isEmpty()
throws TemplateModelException
isEmpty in interface TemplateModeltrue if this object is empty, otherwise false
TemplateModelException
public TemplateModel getAtIndex(long index)
throws TemplateModelException
TemplateIndexedModeljava.util.Vector.
getAtIndex in interface TemplateIndexedModelindex - 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 value
public void putAtIndex(long index,
TemplateModel model)
throws TemplateModelException
TemplateWriteableIndexedModeljava.util.Vector.
putAtIndex in interface TemplateWriteableIndexedModelindex - 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 error
public TemplateIteratorModel templateIterator()
throws TemplateModelException
TemplateListModel2null if there are no elements in the list.
templateIterator in interface TemplateListModel2TemplateModelException - the next item in the list can't be
retrieved, or no next item exists.public void releaseIterator(TemplateIteratorModel iterator)
TemplateListModel2Returns 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 TemplateListModel2iterator - the iterator to be returned to the object pool, if any
public TemplateModel get(java.lang.String key)
throws TemplateModelException
TemplateModel from the hash.
get in interface TemplateHashModelkey - 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 key
public java.lang.Object getAsObject()
throws TemplateModelException
getAsObject in interface TemplateObjectModelTemplateModelException - the object could not be returned
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||