public class IterateTag
extends javax.servlet.jsp.tagext.BodyTagSupport
Modifier and Type | Field and Description |
---|---|
protected Object |
collection
The collection over which we will be iterating.
|
protected String |
id
The name of the scripting variable to be exposed.
|
protected String |
indexId
The name of the scripting variable to be exposed as the current index.
|
protected Iterator |
iterator
Iterator of the elements of this collection, while we are actually
running.
|
protected 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 static MessageResources |
messages
The message resources for this package.
|
protected String |
name
The name of the collection or owning bean.
|
protected String |
offset
The starting offset (zero relative).
|
protected int |
offsetValue
The actual offset value (calculated in the start tag).
|
protected String |
property
The property name containing the collection.
|
protected String |
scope
The scope of the bean specified by the name property, if any.
|
protected boolean |
started
Has this tag instance been started?
|
protected String |
type
The Java class of each exposed element of the collection.
|
Constructor and Description |
---|
IterateTag() |
Modifier and Type | Method and Description |
---|---|
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.
|
Object |
getCollection() |
String |
getId() |
int |
getIndex()
Return the zero-relative index of the current iteration through the
loop.
|
String |
getIndexId() |
String |
getLength() |
String |
getName() |
String |
getOffset() |
String |
getProperty() |
String |
getScope() |
String |
getType() |
void |
release()
Release all allocated resources.
|
void |
setCollection(Object collection) |
void |
setId(String id) |
void |
setIndexId(String indexId) |
void |
setLength(String length) |
void |
setName(String name) |
void |
setOffset(String offset) |
void |
setProperty(String property) |
void |
setScope(String scope) |
void |
setType(String type) |
doInitBody, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
protected static MessageResources messages
protected Iterator iterator
protected int lengthCount
protected int lengthValue
protected int offsetValue
protected boolean started
protected Object collection
protected String id
protected String indexId
protected String length
protected String name
protected String offset
protected String property
protected String scope
protected String type
public Object getCollection()
public void setCollection(Object collection)
public String getId()
getId
in class javax.servlet.jsp.tagext.TagSupport
public void setId(String id)
setId
in class javax.servlet.jsp.tagext.TagSupport
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 String getIndexId()
public void setIndexId(String indexId)
public String getLength()
public void setLength(String length)
public String getName()
public void setName(String name)
public String getOffset()
public void setOffset(String offset)
public String getProperty()
public void setProperty(String property)
public String getScope()
public void setScope(String scope)
public String getType()
public void setType(String type)
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
Copyright © 2000–2016 Apache Software Foundation. All rights reserved.