jodd.servlet.tag
Class LoopingTagSupport

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by jodd.servlet.tag.LoopingTagSupport
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag
Direct Known Subclasses:
ForTag, LoopTag

public abstract class LoopingTagSupport
extends javax.servlet.jsp.tagext.SimpleTagSupport

Support for looping tags.


Field Summary
protected  int end
           
protected  int modulus
           
protected  int start
           
protected  java.lang.String status
           
protected  int step
           
 
Constructor Summary
LoopingTagSupport()
           
 
Method Summary
protected  void loopBody()
          Loops body.
protected  void prepareStepDirection()
          Shorter variant of prepareStepDirection(boolean, boolean).
protected  void prepareStepDirection(boolean autoDirection, boolean checkDirection)
          Prepares step value.
 void setEnd(int end)
          Sets the end loop value (inclusive).
 void setModulus(int modulus)
          Specifies modulus value for the looping status.
 void setStart(int start)
          Sets the first loop value (inclusive).
 void setStatus(java.lang.String status)
          Specifies status variable name.
 void setStep(int step)
          Specifies the loop step.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
doTag, findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

protected int start

end

protected int end

step

protected int step

status

protected java.lang.String status

modulus

protected int modulus
Constructor Detail

LoopingTagSupport

public LoopingTagSupport()
Method Detail

setStart

public void setStart(int start)
Sets the first loop value (inclusive).


setEnd

public void setEnd(int end)
Sets the end loop value (inclusive).


setStep

public void setStep(int step)
Specifies the loop step. If step is 0, it will be set to +1 or -1, depending on start and end values.


setStatus

public void setStatus(java.lang.String status)
Specifies status variable name. If omitted, status will not be used.


setModulus

public void setModulus(int modulus)
Specifies modulus value for the looping status.


prepareStepDirection

protected void prepareStepDirection()
Shorter variant of prepareStepDirection(boolean, boolean).


prepareStepDirection

protected void prepareStepDirection(boolean autoDirection,
                                    boolean checkDirection)
Prepares step value. If step is 0, it will be set to +1 or -1, depending on start and end value.

If autoDirection flag is true then it is assumed that step is positive, and that direction (step sign) should be detected from start and end value.

If checkDirection flag is true than it checks loop direction (step sign) based on start and end value. Throws an exception if direction is invalid. If autoDirection is set, direction checking is skipped.


loopBody

protected void loopBody()
                 throws javax.servlet.jsp.JspException
Loops body.

Throws:
javax.servlet.jsp.JspException


Copyright © 2003-2012 Jodd Team