FileDocCategorySizeDatePackage
ForEachTag.javaAPI DocGlassfish v2 API4856Sat May 05 19:17:54 BST 2007org.apache.taglibs.standard.tag.common.xml

ForEachTag

public class ForEachTag extends javax.servlet.jsp.jstl.core.LoopTagSupport

Support for the XML library's <forEach> tag.

see
javax.servlet.jsp.jstl.core.LoopTagSupport
author
Shawn Bayern

Fields Summary
private String
select
private List
nodes
private int
nodesIndex
private Node
current
Constructors Summary
Methods Summary
public org.w3c.dom.NodegetContext()

	// expose the current node as the context
        return current;
    
protected booleanhasNext()

        return (nodesIndex < nodes.size());
    
private voidinit()

	select = null;
	nodes = null;
	nodesIndex = 0;
	current = null;
    
protected java.lang.Objectnext()

	Object o = nodes.get(nodesIndex++);
	if (!(o instanceof org.w3c.dom.Node))
	    throw new JspTagException(
		Resources.getMessage("FOREACH_NOT_NODESET"));
	current = (org.w3c.dom.Node) o;
        return current;
    
protected voidprepare()

        nodesIndex = 0;
        XPathUtil xu = new XPathUtil(pageContext);
        nodes = xu.selectNodes(XPathUtil.getContext(this), select);
    
public voidrelease()

	init();
        super.release();
    
public voidsetBegin(int begin)

        this.beginSpecified = true;
        this.begin = begin;
        validateBegin();
    
public voidsetEnd(int end)

        this.endSpecified = true;
        this.end = end;
        validateEnd();
    
public voidsetSelect(java.lang.String select)

	this.select = select;
    
public voidsetStep(int step)

        this.stepSpecified = true;
        this.step = step;
        validateStep();