javax.servlet.jsp.jstl.core
Class LoopTagSupport

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.jstl.core.LoopTagSupport
All Implemented Interfaces:
java.io.Serializable, LoopTag, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
CoreForEachTag, CoreForTokensTag

public abstract class LoopTagSupport
extends TagSupport
implements IterationTag, TryCatchFinally, LoopTag

See Also:
Serialized Form

Field Summary
protected  int begin
           
protected  boolean beginSpecified
           
protected  ValueExpression deferredExpression
           
protected  int end
           
protected  boolean endSpecified
           
protected  java.lang.String itemId
           
protected  java.lang.String statusId
           
protected  int step
           
protected  boolean stepSpecified
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LoopTagSupport()
           
 
Method Summary
 int doAfterBody()
          Processed to check if the tag should loop.
 void doCatch(java.lang.Throwable t)
          Invoked if any exception is thrown while evaluating the tag.
 void doFinally()
          Invoked after doEndTag even with an exception.
 int doStartTag()
          Starts the iteration.
 java.lang.Object getCurrent()
          Returns the current object.
protected  java.lang.String getDelims()
           
 LoopTagStatus getLoopStatus()
          Returns the loop status.
protected abstract  boolean hasNext()
          Returns true if there are more values in the tag.
protected abstract  java.lang.Object next()
          Returns the next object for the tag.
protected abstract  void prepare()
          Called before iteration starts
 void setVar(java.lang.String id)
          Sets the var attribute.
 void setVarStatus(java.lang.String id)
          Sets the var status attribute.
protected  void validateBegin()
          Checks that the begin property makes sense.
protected  void validateEnd()
          Checks that the end property makes sense.
protected  void validateStep()
          Checks that the step property makes sense.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, getParent, release, setPageContext, setParent
 

Field Detail

begin

protected int begin

beginSpecified

protected boolean beginSpecified

deferredExpression

protected ValueExpression deferredExpression

end

protected int end

endSpecified

protected boolean endSpecified

step

protected int step

stepSpecified

protected boolean stepSpecified

itemId

protected java.lang.String itemId

statusId

protected java.lang.String statusId
Constructor Detail

LoopTagSupport

public LoopTagSupport()
Method Detail

setVar

public void setVar(java.lang.String id)
Sets the var attribute.


setVarStatus

public void setVarStatus(java.lang.String id)
Sets the var status attribute.


validateBegin

protected void validateBegin()
                      throws JspTagException
Checks that the begin property makes sense.

Throws:
JspTagException

validateEnd

protected void validateEnd()
                    throws JspTagException
Checks that the end property makes sense.

Throws:
JspTagException

validateStep

protected void validateStep()
                     throws JspTagException
Checks that the step property makes sense.

Throws:
JspTagException

prepare

protected abstract void prepare()
                         throws JspTagException
Called before iteration starts

Throws:
JspTagException

next

protected abstract java.lang.Object next()
                                  throws JspTagException
Returns the next object for the tag.

Throws:
JspTagException

hasNext

protected abstract boolean hasNext()
                            throws JspTagException
Returns true if there are more values in the tag.

Throws:
JspTagException

getCurrent

public java.lang.Object getCurrent()
Returns the current object.

Specified by:
getCurrent in interface LoopTag

getLoopStatus

public LoopTagStatus getLoopStatus()
Returns the loop status.

Specified by:
getLoopStatus in interface LoopTag

doStartTag

public int doStartTag()
               throws JspException
Starts the iteration.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY to ignore the body and EVAL_BODY_INCLUDE to evaluate the body.
Throws:
JspException

doAfterBody

public int doAfterBody()
                throws JspException
Description copied from class: TagSupport
Processed to check if the tag should loop. The default behavior returns SKIP_BODY so it does not loop.

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class TagSupport
Returns:
EVAL_BODY_AGAIN to repeat the body or SKIP_BODY to stop.
Throws:
JspException

doCatch

public void doCatch(java.lang.Throwable t)
             throws java.lang.Throwable
Description copied from interface: TryCatchFinally
Invoked if any exception is thrown while evaluating the tag.

Specified by:
doCatch in interface TryCatchFinally
Parameters:
t - the thrown exception
Throws:
java.lang.Throwable

doFinally

public void doFinally()
Description copied from interface: TryCatchFinally
Invoked after doEndTag even with an exception.

Specified by:
doFinally in interface TryCatchFinally

getDelims

protected java.lang.String getDelims()