Package org.apache.wiki.tags
Class IteratorTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.wiki.tags.IteratorTag
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag,javax.servlet.jsp.tagext.TryCatchFinally
- Direct Known Subclasses:
AdminBeanIteratorTag,AttachmentsIteratorTag,EditorIteratorTag,HistoryIteratorTag,SearchResultIteratorTag
public abstract class IteratorTag extends javax.servlet.jsp.tagext.BodyTagSupport implements javax.servlet.jsp.tagext.TryCatchFinally
Iterates through tags.
Attributes
- list - a collection.
- Since:
- 2.0
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected Iterator<?>m_iteratorprotected Stringm_pageNameprotected Contextm_wikiContextFields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors Constructor Description IteratorTag() -
Method Summary
Modifier and Type Method Description voidclearList()Clears the iterator away.intdoAfterBody()voiddoCatch(Throwable arg0)In case your tag throws an exception at any point, you can override this method and implement a custom exception handler.intdoEndTag()voiddoFinally()Executed after the tag has been finished.intdoStartTag()voidresetIterator()Override this method to reset your own iterator.voidsetList(Object[] arg)Sets the collection list, but using an array.voidsetList(Collection<?> arg)Sets the collection that is used to form the iteration.Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Field Details
-
m_pageName
-
m_iterator
-
m_wikiContext
-
-
Constructor Details
-
IteratorTag
public IteratorTag()
-
-
Method Details
-
setList
Sets the collection that is used to form the iteration.- Parameters:
arg- A Collection which will be iterated.
-
setList
Sets the collection list, but using an array.- Parameters:
arg- An array of objects which will be iterated.
-
clearList
Clears the iterator away. After calling this method doStartTag() will always return SKIP_BODY -
resetIterator
Override this method to reset your own iterator. -
doStartTag
- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport
-
doEndTag
- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport
-
doAfterBody
- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport
-
doCatch
In case your tag throws an exception at any point, you can override this method and implement a custom exception handler.By default, this handler does nothing.
- Specified by:
doCatchin interfacejavax.servlet.jsp.tagext.TryCatchFinally- Parameters:
arg0- The Throwable that the tag threw- Throws:
Throwable- I have no idea why this would throw anything
-
doFinally
Executed after the tag has been finished. This is a great place to put any cleanup code. However you must call super.doFinally() if you override this method, or else some of the things may not work as expected.- Specified by:
doFinallyin interfacejavax.servlet.jsp.tagext.TryCatchFinally
-