Class ForTokensSupport

All Implemented Interfaces:
LoopTag, IterationTag, JspTag, Tag, TryCatchFinally, Serializable
Direct Known Subclasses:
ForTokensTag, ForTokensTag

public abstract class ForTokensSupport extends LoopTagSupport

Support for tag handlers for <forTokens>, the tokenizing iteration tag in JSTL 1.0. This class extends LoopTagSupport and provides ForTokens-specific functionality. The rtexprvalue and expression-evaluating libraries each have handlers that extend this class.

Author:
Shawn Bayern
See Also:
  • Field Details

  • Constructor Details

    • ForTokensSupport

      public ForTokensSupport()
  • Method Details

    • prepare

      protected void prepare() throws JspTagException
      Description copied from class: LoopTagSupport

      Prepares for a single tag invocation. Specifically, allows subclasses to prepare for calls to hasNext() and next(). Subclasses can assume that prepare() will be called once for each invocation of doStartTag() in the superclass.

      Specified by:
      prepare in class LoopTagSupport
      Throws:
      JspTagException - thrown on error
    • hasNext

      protected boolean hasNext() throws JspTagException
      Description copied from class: LoopTagSupport

      Returns information concerning the availability of more items over which to iterate. This method must be provided by concrete subclasses of LoopTagSupport to assist the iterative logic provided by the supporting base class.

      See next for more information about the purpose and expectations behind this tag.

      Specified by:
      hasNext in class LoopTagSupport
      Returns:
      true if there is at least one more item to iterate over, false otherwise
      Throws:
      JspTagException - thrown on error
      See Also:
    • next

      protected Object next() throws JspTagException
      Description copied from class: LoopTagSupport

      Returns the next object over which the tag should iterate. This method must be provided by concrete subclasses of LoopTagSupport to inform the base logic about what objects it should iterate over.

      It is expected that this method will generally be backed by an Iterator, but this will not always be the case. In particular, if retrieving the next object raises the possibility of an exception being thrown, this method allows that exception to propagate back to the JSP container as a JspTagException; a standalone Iterator would not be able to do this. (This explains why LoopTagSupport does not simply call for an Iterator from its subtags.)

      Specified by:
      next in class LoopTagSupport
      Returns:
      the java.lang.Object to use in the next round of iteration
      Throws:
      JspTagException - for other, unexpected exceptions
    • getDelims

      protected String getDelims()
      Overrides:
      getDelims in class LoopTagSupport
    • release

      public void release()
      Description copied from class: LoopTagSupport
      Releases any resources this LoopTagSupport may have (or inherit).
      Specified by:
      release in interface Tag
      Overrides:
      release in class LoopTagSupport
      See Also: