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

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended byorg.mmbase.bridge.jsp.taglib.NodeReferrerTag
                      extended byorg.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
                          extended byorg.mmbase.bridge.jsp.taglib.functions.NodeListFunctionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, ContainerReferrer, ContextProvider, FunctionContainerOrNodeProvider, FunctionContainerReferrer, javax.servlet.jsp.tagext.IterationTag, ListProvider, NodeProvider, QueryContainerOrListProvider, java.io.Serializable, javax.servlet.jsp.tagext.Tag, TagIdentifier

public class NodeListFunctionTag
extends AbstractFunctionTag
implements ListProvider, FunctionContainerReferrer, NodeProvider

A function tag for functions returning a NodeList. The result is iterated. This is one of the most straightforward ListProvider/NodeProvider implementations, you could use it as a template.

Since:
MMBase-1.7
Version:
$Id: NodeListFunctionTag.java,v 1.3.2.2 2004/07/26 20:12:20 nico Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
container, functionSet, module, name, nodeManager, parametersAttr, referids
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
parentNodeId
 
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.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
NodeListFunctionTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
 ContextContainer getContextContainer()
           
 java.lang.Object getCurrent()
           
 int getIndex()
           
 int getIndexOffset()
           
 Node getNodeVar()
           
 boolean isChanged()
           
 void remove()
          Removes the current item from the list.
 void setComparator(java.lang.String c)
           
 void setJspvar(java.lang.String jv)
           
 void setMax(java.lang.String m)
           
 void setModified()
           
 void setOffset(java.lang.String o)
           
 int size()
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag
fillStandardParameters, getFunction, getFunctionValue, setContainer, setModule, setName, setNodemanager, setParameters, setReferids, setSet
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
findNodeProvider, findNodeProvider, getNode, setNode
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
findCloudProvider, findCloudProvider, getCloud, getCloudContext, getCloudVar, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getId, getLocale, getObject, getPageContext, getReferid, getString, getWriterValue, haveBody, release, setContext, setEscape, setId, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, 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.TagIdentifier
getId
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.containers.FunctionContainerReferrer
setContainer
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

NodeListFunctionTag

public NodeListFunctionTag()
Method Detail

getNodeVar

public Node getNodeVar()
                throws javax.servlet.jsp.JspTagException
Specified by:
getNodeVar in interface NodeProvider
Returns:
the node contained in the tag NOTE: we have decided to call this methid getNodeVar because we use tag attributes with name "node" and type String
Throws:
javax.servlet.jsp.JspTagException

setModified

public void setModified()
Specified by:
setModified in interface NodeProvider

setJspvar

public void setJspvar(java.lang.String jv)
Specified by:
setJspvar in interface NodeProvider
Overrides:
setJspvar in class ContextReferrerTag

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 java.lang.Object getCurrent()
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

setMax

public void setMax(java.lang.String m)
            throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setOffset

public void setOffset(java.lang.String o)
               throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setComparator

public void setComparator(java.lang.String c)
                   throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getContextContainer

public ContextContainer getContextContainer()
                                     throws javax.servlet.jsp.JspTagException
Specified by:
getContextContainer in interface ContextProvider
Throws:
javax.servlet.jsp.JspTagException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspTagException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspTagException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
javax.servlet.jsp.JspTagException


MMBase build 1.7.1.20041002