Interface IterationTag

All Superinterfaces:
Component, Tag
All Known Subinterfaces:
All Known Implementing Classes:
ForEachSupport, ForEachTag, IterationTestTag, LoopTagSupport, MonthsTag, UIComponentBodyTag, VerbatimTag

public interface IterationTag
extends Tag

The IterationTag interface extends Tag by defining one additional method that controls the reevaluation of its body.

A tag handler that implements IterationTag is treated as one that implements Tag regarding the doStartTag() and doEndTag() methods. IterationTag provides a new method: doAfterBody().

The doAfterBody() method is invoked after every body evaluation to control whether the body will be reevaluated or not. If doAfterBody() returns IterationTag.EVAL_BODY_AGAIN, then the body will be reevaluated. If doAfterBody() returns Tag.SKIP_BODY, then the body will be skipped and doEndTag() will be evaluated instead.

CVS $Id: IterationTag.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Volker Schmitt

Field Summary
static int EVAL_BODY_AGAIN
          Request the reevaluation of some body.
Fields inherited from interface org.apache.cocoon.taglib.Tag
Method Summary
 int doAfterBody()
          Process body (re)evaluation.
Methods inherited from interface org.apache.cocoon.taglib.Tag
doEndTag, doStartTag, getParent, setParent, setup

Field Detail


static final int EVAL_BODY_AGAIN
Request the reevaluation of some body. Returned from doAfterBody.

See Also:
Constant Field Values
Method Detail


int doAfterBody()
                throws SAXException
Process body (re)evaluation. This method is invoked by the Taglib implementation object after every evaluation of the body into the BodyEvaluation object. The method is not invoked if there is no body evaluation.

If doAfterBody returns EVAL_BODY_AGAIN, a new evaluation of the body will happen (followed by another invocation of doAfterBody). If doAfterBody returns SKIP_BODY no more body evaluations will occur and then doEndTag will be invoked.

The method re-invocations may be lead to different actions because there might have been some changes to shared state, or because of external computation.

whether additional evaluations of the body are desired

Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.