org.mmbase.bridge.jsp.taglib
Class NodeListHelper

java.lang.Object
  extended byorg.mmbase.bridge.jsp.taglib.NodeListHelper
All Implemented Interfaces:
ContextProvider, ListProvider, LoopTag, Tag, TagIdentifier

public class NodeListHelper
extends Object
implements ListProvider

Since:
MMBase-1.7
Version:
$Id: NodeListHelper.java,v 1.26 2006/07/09 14:16:11 michiel Exp $
Author:
Michiel Meeuwissen

Nested Class Summary
 
Nested classes inherited from class org.mmbase.bridge.jsp.taglib.ListProvider
ListProvider.ListProviderLoopTagStatus
 
Field Summary
protected  Attribute add
           
protected  boolean changed
          Determines whether a field in AbstractNodeListTag.orderby changed during iteration.
protected  Attribute comparator
           
protected  int currentItemIndex
          The current item
protected  Attribute max
          The maximum number of elements in a list.
protected  NodeIterator nodeIterator
          Data member to hold an iteration of the values to return.
protected  Attribute offset
          The offset of the elements that are returned in a list.
protected  Attribute remove
           
protected  Attribute retain
           
protected  NodeList returnList
           
protected  int timerHandle
          A handle necessary when using the Time Tag;
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
NodeListHelper(ContextReferrerTag thisTag, NodeProviderHelper nodeHelper)
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
 void doStartTagHelper()
           
 String getComparator()
           
 ContextContainer getContextContainer()
           
 Object getCurrent()
           
protected  String getFirstOrderedField(NodeList returnList, NodeManager nextNodeManager)
          The first ordered field is used to determin the 'changed' status of a Node in a NodeList.
 String getId()
           
 int getIndex()
           
 int getIndexOffset()
           
 LoopTagStatus getLoopStatus()
           
 Attribute getMax()
           
 Attribute getOffset()
           
 PageContext getPageContext()
           
 Tag getParent()
           
 NodeList getReturnList()
           
 boolean isChanged()
          If you order a list, then the 'changed' property will be true if the field on which you order changed value.
 void release()
           
 void remove()
          Removes the current item from the list.
 void setAdd(String a)
           
 void setComparator(String c)
           
 void setMax(String m)
          Set the list maximum
 void setNext()
           
 void setOffset(String o)
          Set the list offset
 void setPageContext(PageContext pc)
           
 void setParent(Tag tag)
           
 void setRemove(String a)
           
 void setRetain(String a)
           
 int setReturnValues(NodeList nodes, boolean trim)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

max

protected Attribute max
The maximum number of elements in a list. Setting the list size to conform to this maximum is implementation specific.


offset

protected Attribute offset
The offset of the elements that are returned in a list. Setting the list to conform to this ofsset is implementation specific.


comparator

protected Attribute comparator

add

protected Attribute add

retain

protected Attribute retain

remove

protected Attribute remove

changed

protected boolean changed
Determines whether a field in AbstractNodeListTag.orderby changed during iteration.


nodeIterator

protected NodeIterator nodeIterator
Data member to hold an iteration of the values to return. This variable is set in setReturnValues(NodeList, boolean), which should be called from BodyTagSupport.doStartTag(), and will be used to fill the return variables for every iteration.


returnList

protected NodeList returnList

currentItemIndex

protected int currentItemIndex
The current item


timerHandle

protected int timerHandle
A handle necessary when using the Time Tag;

Constructor Detail

NodeListHelper

public NodeListHelper(ContextReferrerTag thisTag,
                      NodeProviderHelper nodeHelper)
Method Detail

getId

public String getId()
Specified by:
getId in interface TagIdentifier
Returns:
the String id the the tag. Id is is a user defined identifier

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)

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(String m)
            throws JspTagException
Set the list maximum

Parameters:
m - the max number of values returned
Throws:
JspTagException

getMax

public Attribute getMax()

setOffset

public void setOffset(String o)
               throws JspTagException
Set the list offset

Parameters:
o - The offset for the List.
Throws:
JspTagException

getOffset

public Attribute getOffset()

setComparator

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

setAdd

public void setAdd(String a)
            throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8

setRetain

public void setRetain(String a)
               throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8

setRemove

public void setRemove(String a)
               throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8

getComparator

public String getComparator()
                     throws JspTagException
Throws:
JspTagException

getReturnList

public NodeList getReturnList()

getContextContainer

public ContextContainer getContextContainer()
                                     throws JspTagException
Specified by:
getContextContainer in interface ContextProvider
Throws:
JspTagException

getPageContext

public PageContext getPageContext()
                           throws JspTagException
Specified by:
getPageContext in interface ContextProvider
Throws:
JspTagException

setReturnValues

public int setReturnValues(NodeList nodes,
                           boolean trim)
                    throws JspTagException
Throws:
JspTagException

doStartTagHelper

public void doStartTagHelper()
                      throws JspTagException
Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspTagException
Throws:
JspTagException

doEndTag

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

getFirstOrderedField

protected String getFirstOrderedField(NodeList returnList,
                                      NodeManager nextNodeManager)
The first ordered field is used to determin the 'changed' status of a Node in a NodeList.

Since:
MMBase-1.8

setNext

public void setNext()
             throws JspTagException
Throws:
JspTagException

isChanged

public boolean isChanged()
If you order a list, then the 'changed' property will be true if the field on which you order changed value.

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

size

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

getCurrent

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

getLoopStatus

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

release

public void release()
Specified by:
release in interface Tag

doStartTag

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

getParent

public Tag getParent()
Specified by:
getParent in interface Tag

setParent

public void setParent(Tag tag)
Specified by:
setParent in interface Tag

setPageContext

public void setPageContext(PageContext pc)
Specified by:
setPageContext in interface Tag


MMBase build 1.8.1.20060716