WW-2216 Improve/complete JavaDocs for IteratorStatus/<s:iterator/> tag.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580128 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Musachy Barroso
2007-09-27 19:15:04 +00:00
parent 8645eee9bd
commit c8eef15176
@@ -23,9 +23,30 @@ package org.apache.struts2.views.jsp;
/**
* The iterator tag can export an IteratorStatus object so that
* one can get information about the status of the iteration, such as
* the size, current index, and whether any more items are available.
*
* one can get information about the status of the iteration, such as:
* <ul>
* <li>index: current iteration index, starts on 0 and increments in one on every iteration</li>
* <li>count: iterations so far, starts on 1. count is always index + 1</li>
* <li>first: true if index == 0</li>
* <li>even: true if (index + 1) % 2 == 0</li>
* <li>last: true if current iteration is the last iteration</li>
* <li>odd: true if (index + 1) % 2 == 1</li>
* </ul>
* <p>Example</p>
* <pre>
* &lt;s:iterator status="status" value='%{0, 1}'&gt;
* Index: &lt;s:property value="%{#status.index}" /&gt; &lt;br /&gt;
* Count: &lt;s:property value="%{#status.count}" /&gt; &lt;br /&gt;
* &lt;/s:iterator>
* </pre>
*
* <p>will print</p>
* <pre>
* Index: 0
* Count: 1
* Index: 1
* Count: 2
* </pre>
*/
public class IteratorStatus {
protected StatusState state;