## org.eclipse.jet.taglib
Interface IteratingTag

All Superinterfaces:
  ContainerTag, CustomTag, EmptyTag

All Known Implementing Classes:
  AbstractIteratingTag

    public interface IteratingTag

extends ContainerTag

Define the behavior of a JET2 iterating tag. An iterating tag: <bl>

- Must be of the form an open-tag (<myiterate>) and a close-tag (</myiterate>).
- Control the number of times the body content is written via the methods `doInitializeLoop(TagInfo, JET2Context)` and `doEvalLoopCondition(TagInfo, JET2Context)`.
</bl> Methods are called in the following sequence: <bl>
- The set*() methods as defined by `CustomTag` to initialize the tag
- `doInitializeLoop(TagInfo, JET2Context)` is called to allow the tag to determine the loop data.
- `doEvalLoopCondition(TagInfo, JET2Context)` is called multiple times to traverse the loop data.
- Each time `doEvalLoopCondition(TagInfo, JET2Context)` returns `true`, then the body processing methods are called as described in `ContainerTag`.
</bl>

Method Summary
`boolean` `doEvalLoopCondition(TagInfo td, JET2Context context)` Determine whether the tag should do another iteration, and, if so, setup any data for the iteration.
`void` `doInitializeLoop(TagInfo td, JET2Context context)` Initialize any data required to determine how many times the tag should iterate.

Methods inherited from interface org.eclipse.jet.taglib.ContainerTag
`doAfterBody, doBeforeBody, setBodyContent`

Methods inherited from interface org.eclipse.jet.taglib.EmptyTag
`doAction`

Method Detail

### doEvalLoopCondition

    boolean doEvalLoopCondition(TagInfo td,
                                JET2Context context)
                                throws JET2TagException

  Determine whether the tag should do another iteration, and, if so, setup any data for the iteration. This method is called one more more times after the call to `doInitializeLoop(TagInfo, JET2Context)`.

  Parameters:
    `td` - the tag information (attribute values, etc)
    `context` - the JET2 execution context.
  Returns:
    `true` if another iteration is to be performed, `false` otherwise.
  Throws:
    `JET2TagException` - if the method cannot complete successfully. Note that this will terminate the tag loop.

### doInitializeLoop

    void doInitializeLoop(TagInfo td,
                          JET2Context context)
                          throws JET2TagException

  Initialize any data required to determine how many times the tag should iterate. This method is called once, and is called prior to any calls to `doEvalLoopCondition(TagInfo, JET2Context)`.

  Parameters:
    `td` - the tag data (attribute values, etc)
    `context` - the JET2 exectuion context
  Throws:
    `JET2TagException` - if the method cannot execute successfully.

Copyright 2006 IBM Corporation and others. All Rights Reserved.