org.mmbase.bridge.jsp.taglib.functions
Class ListFunctionTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended by org.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended by org.mmbase.bridge.jsp.taglib.NodeReferrerTag
                      extended by org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
                          extended by org.mmbase.bridge.jsp.taglib.functions.ListFunctionTag
All Implemented Interfaces:
Serializable, LoopTag, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, ContainerReferrer, FunctionContainerReferrer, ContextProvider, ListProvider, TagIdentifier, Writer

public class ListFunctionTag
extends AbstractFunctionTag
implements ListProvider, FunctionContainerReferrer, Writer

A function tag for functions returning a collection. The result is iterated. If a function does not return collection, or if the result requires sorting, the result value is transformed into a List (using Casting.toCollection(java.lang.Object, java.lang.String)).

Since:
MMBase-1.7
Version:
$Id: ListFunctionTag.java 42044 2010-04-26 13:56:53Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mmbase.bridge.jsp.taglib.ListProvider
ListProvider.ListProviderLoopTagStatus
 
Field Summary
protected  Attribute comparator
           
protected  int currentItemIndex
           
protected  Iterator iterator
           
protected  Attribute max
           
protected  Attribute offset
           
protected  Collection returnCollection
           
protected  Attribute varStatus
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
add, container, functionClass, functionSet, module, name, nodeManager, parametersAttr, referids, remove, retain, THISPAGE
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
parentNodeId
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
cloudId
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Constructor Summary
ListFunctionTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 void doFinally()
           
 void doInitBody()
           
 int doStartTag()
           
 ContextContainer getContextContainer()
           
 Object getCurrent()
           
 int getIndex()
           
 int getIndexOffset()
           
 LoopTagStatus getLoopStatus()
           
 boolean isChanged()
           
 void remove()
          Removes the current item from the list.
 void setComparator(String c)
           
 void setMax(String m)
           
 void setOffset(String o)
           
 void setVarStatus(String s)
           
 int size()
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
getFunction, getFunction, getFunction, getFunctionValue, getFunctionValue, setAdd, setClassname, setContainer, setModule, setName, setNodemanager, setParameters, setReferids, setRemove, setRetain, setSet, useCollectionMethods
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
fillStandardParameters, findNode, findNodeProvider, findNodeProvider, getCloudVar, getLocale, getNode, getNode, getNodeFromPageContext, initTag, setElement, setNode
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
findCloudProvider, findCloudProvider, getCloudContext, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
appendMoreParameters, doCatch, findLoopOrQuery, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getCurrentBlock, getDefaultLocale, getEscapedValue, getFormTag, getId, getLocaleFromContext, getObject, getObjectConditional, getPageContext, getPageContextTag, getQuery, getReferid, getString, getTaglibVersion, getThreadPageContext, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setListdelimiter, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.ListProvider
setAdd, setRemove, setRetain
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.ContextProvider
getPageContext
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.TagIdentifier
getId
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, release, setPageContext, setParent
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.containers.FunctionContainerReferrer
setContainer
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.Writer
getWriterValue, haveBody, setEscape, setJspvar, setVartype, setWrite
 

Field Detail

returnCollection

protected Collection returnCollection

iterator

protected Iterator iterator

currentItemIndex

protected int currentItemIndex

comparator

protected Attribute comparator

varStatus

protected Attribute varStatus

max

protected Attribute max

offset

protected Attribute offset
Constructor Detail

ListFunctionTag

public ListFunctionTag()
Method Detail

setComparator

public void setComparator(String c)
                   throws JspTagException
Throws:
JspTagException

setVarStatus

public void setVarStatus(String s)
                  throws JspTagException
Throws:
JspTagException

setMax

public void setMax(String m)
            throws JspTagException
Throws:
JspTagException

setOffset

public void setOffset(String o)
               throws JspTagException
Throws:
JspTagException

size

public int size()
Specified by:
size in interface ListProvider
Returns:
the size of the list

getIndex

public int getIndex()
Specified by:
getIndex in interface ListProvider
Returns:
the index of the current item in a list

getIndexOffset

public int getIndexOffset()
Specified by:
getIndexOffset in interface ListProvider
Returns:
The offset of the index (normally this will return 1)

isChanged

public boolean isChanged()
Specified by:
isChanged in interface ListProvider
Returns:
a boolean indicating wether the field on which was sorted is changed.

getCurrent

public Object getCurrent()
Specified by:
getCurrent in interface LoopTag
Specified by:
getCurrent in interface ListProvider
Returns:
the current item in a list

remove

public void remove()
Description copied from interface: ListProvider
Removes the current item from the list.

Specified by:
remove in interface ListProvider

getContextContainer

public ContextContainer getContextContainer()
Specified by:
getContextContainer in interface ContextProvider

doStartTag

public int doStartTag()
               throws JspTagException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class NodeReferrerTag
Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspException
Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class BodyTagSupport
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspTagException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class NodeReferrerTag
Throws:
JspTagException

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class ContextReferrerTag

doInitBody

public void doInitBody()
                throws JspTagException
Specified by:
doInitBody in interface BodyTag
Overrides:
doInitBody in class BodyTagSupport
Throws:
JspTagException

getLoopStatus

public LoopTagStatus getLoopStatus()
Specified by:
getLoopStatus in interface LoopTag


MMBase 2.0-SNAPSHOT - null