|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBodyTagSupport
it.eng.spago.taglib.logic.IterateTag
public class IterateTag
Custom tag that iterates the elements of a collection, which can be either an attribute or the property of an attribute. The collection can be any of the following: an array of objects, an Enumeration, an Iterator, a Collection (which includes Lists, Sets and Vectors), or a Map (which includes Hashtables) whose elements will be iterated over.
Field Summary | |
---|---|
protected java.lang.Object |
collection
The collection over which we will be iterating. |
protected java.lang.String |
id
The name of the scripting variable to be exposed. |
protected java.lang.String |
indexId
The name of the scripting variable to be exposed as the current index. |
protected java.util.Iterator |
iterator
Iterator of the elements of this collection, while we are actually running. |
protected java.lang.String |
length
The length value or attribute name (<=0 means no limit). |
protected int |
lengthCount
The number of elements we have already rendered. |
protected int |
lengthValue
The actual length value (calculated in the start tag). |
protected java.lang.String |
listAttribute
|
protected static MessageBundleReference |
messages
The message resources for this package. |
protected java.lang.String |
name
The name of the collection or owning bean. |
protected java.lang.String |
offset
The starting offset (zero relative). |
protected int |
offsetValue
The actual offset value (calculated in the start tag). |
protected java.lang.String |
paramName
The attribute paramName is used in conjunction with
the attribute paramValue and the attribute
listAttribute to filter a SourceBeanAttribute. |
protected java.lang.String |
paramValue
|
protected java.lang.String |
scope
The scope of the bean specified by the name property, if any. |
protected boolean |
started
Has this tag instance been started? |
Constructor Summary | |
---|---|
IterateTag()
|
Method Summary | |
---|---|
int |
doAfterBody()
Make the next collection element available and loop, or finish the iterations if there are no more elements. |
int |
doEndTag()
Clean up after processing this enumeration. |
int |
doStartTag()
Construct an iterator for the specified collection, and begin looping through the body once per element. |
java.lang.Object |
getCollection()
|
java.lang.String |
getId()
|
int |
getIndex()
Return the zero-relative index of the current iteration through the loop. |
java.lang.String |
getIndexId()
|
java.lang.String |
getLength()
|
java.lang.String |
getListAttribute()
|
java.lang.String |
getName()
|
java.lang.String |
getOffset()
|
java.lang.String |
getParamName()
|
java.lang.String |
getParamValue()
|
java.lang.String |
getScope()
|
void |
release()
Release all allocated resources. |
void |
setCollection(java.lang.Object collection)
|
void |
setId(java.lang.String id)
|
void |
setIndexId(java.lang.String indexId)
|
void |
setLength(java.lang.String length)
|
void |
setListAttribute(java.lang.String listAttribute)
|
void |
setName(java.lang.String name)
|
void |
setOffset(java.lang.String offset)
|
void |
setParamName(java.lang.String paramName)
|
void |
setParamValue(java.lang.String paramValue)
|
void |
setScope(java.lang.String scope)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static MessageBundleReference messages
protected java.util.Iterator iterator
protected int lengthCount
protected int lengthValue
protected int offsetValue
protected boolean started
protected java.lang.Object collection
protected java.lang.String id
protected java.lang.String indexId
protected java.lang.String length
protected java.lang.String listAttribute
paramName
protected java.lang.String name
protected java.lang.String offset
protected java.lang.String paramName
paramName
is used in conjunction with
the attribute paramValue
and the attribute
listAttribute
to filter a SourceBeanAttribute.
In this way is possible to navigate a SourceBean to a path that
indicate a list of SourceBeanAttribute to filter; the filter is
rappresented with the pair (paramName
, paramValue
).
If the obtained attribute contain a list identified by
listAttribute
, this list is returned.
protected java.lang.String paramValue
paramName
protected java.lang.String scope
Constructor Detail |
---|
public IterateTag()
Method Detail |
---|
public java.lang.Object getCollection()
public void setCollection(java.lang.Object collection)
public java.lang.String getId()
public void setId(java.lang.String id)
public int getIndex()
Return the zero-relative index of the current iteration through the
loop. If you specify an offset
, the first iteration
through the loop will have that value; otherwise, the first iteration
will return zero.
This property is read-only, and gives nested custom tags access to
this information. Therefore, it is only valid in
between calls to doStartTag()
and doEndTag()
.
public java.lang.String getIndexId()
public void setIndexId(java.lang.String indexId)
public java.lang.String getLength()
public void setLength(java.lang.String length)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getOffset()
public void setOffset(java.lang.String offset)
public java.lang.String getScope()
public void setScope(java.lang.String scope)
public java.lang.String getListAttribute()
public void setListAttribute(java.lang.String listAttribute)
public java.lang.String getParamName()
public void setParamName(java.lang.String paramName)
public java.lang.String getParamValue()
public void setParamValue(java.lang.String paramValue)
public int doStartTag() throws JspException
JspException
- if a JSP exception has occurredpublic int doAfterBody() throws JspException
JspException
- if a JSP exception has occurredpublic int doEndTag() throws JspException
JspException
- if a JSP exception has occurredpublic void release()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |