📄 sampledatatagiteratorcollection.java
字号:
package jsp.tags.dapact.samples;
import java.util.ArrayList;
import java.util.Collection;
import jsp.tags.dapact.tags.data.*;
/**
* Title: Data Aware Processing And Control Tags
* Description: Tag library for the processing and controlling the input and output of data.
* Copyright: LGPL (http://www.gnu.org/copyleft/lesser.html)
* Compile Date: @compile_date@
* @author Allen M Servedio
* @amp_sign@version @VERSION@
*/
/**
* Sample data tag iteration class that returns a collection to be iterated over. In
* this instance, the collection resides within the class, but there is certainly
* no reason that the collection could not be retrieved from elsewhere in the system
* (it is in this class for simplicity of example).
*/
public class SampleDataTagIteratorCollection extends BaseDataTagIteratorCollection
{
/**
* Default constructor.
*/
public SampleDataTagIteratorCollection()
{
}
/**
* Returns a sample collection to be iterated over (5 entries exist in this sample).
*
* @return collection to be iterated over.
*/
protected Collection getCollection()
{
ArrayList arrList = new ArrayList(5);
// Please excuse this highly inefficient code, I am allowing the horrid string
// concatenation (resulting in the creation of a string buffer for each entry)
// just to keep the example simple. You should never do this type of concatenation
// in production code.
arrList.add("Entry 1 for " + getName());
arrList.add("Entry 2 for " + getName());
arrList.add("Entry 3 for " + getName());
arrList.add("Entry 4 for " + getName());
arrList.add("Entry 5 for " + getName());
return arrList;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -