mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
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:
@@ -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>
|
||||
* <s:iterator status="status" value='%{0, 1}'>
|
||||
* Index: <s:property value="%{#status.index}" /> <br />
|
||||
* Count: <s:property value="%{#status.count}" /> <br />
|
||||
* </s:iterator>
|
||||
* </pre>
|
||||
*
|
||||
* <p>will print</p>
|
||||
* <pre>
|
||||
* Index: 0
|
||||
* Count: 1
|
||||
* Index: 1
|
||||
* Count: 2
|
||||
* </pre>
|
||||
*/
|
||||
public class IteratorStatus {
|
||||
protected StatusState state;
|
||||
|
||||
Reference in New Issue
Block a user