org.mmbase.bridge.jsp.taglib
Class NodeListHelper

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

public class NodeListHelper
extends java.lang.Object
implements ListProvider

Since:
MMBase-1.7
Version:
$Id: NodeListHelper.java,v 1.5.2.1 2004/07/05 17:19:59 michiel Exp $
Author:
Michiel Meeuwissen

Field Summary
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  NodeList returnList
           
protected  int timerHandle
          A handle necessary when using the Time Tag;
 
Constructor Summary
NodeListHelper(ContextReferrerTag thisTag, NodeProviderHelper nodeHelper)
           
 
Method Summary
 int doAfterBody()
           
 void doEndTag()
           
 void doStartTagHelper()
           
 java.lang.String getComparator()
           
 ContextContainer getContextContainer()
           
 java.lang.Object getCurrent()
           
 java.lang.String getId()
           
 int getIndex()
           
 int getIndexOffset()
           
 Attribute getMax()
           
 Attribute getOffset()
           
 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 remove()
          Removes the current item from the list.
 void setComparator(java.lang.String c)
           
 void setMax(java.lang.String m)
          Set the list maximum
 void setNext()
           
 void setOffset(java.lang.String o)
          Set the list offset
 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

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 java.lang.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(java.lang.String m)
            throws javax.servlet.jsp.JspTagException
Set the list maximum

Parameters:
m - the max number of values returned
Throws:
javax.servlet.jsp.JspTagException

getMax

public Attribute getMax()

setOffset

public void setOffset(java.lang.String o)
               throws javax.servlet.jsp.JspTagException
Set the list offset

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

getOffset

public Attribute getOffset()

setComparator

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

getComparator

public java.lang.String getComparator()
                               throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getReturnList

public NodeList getReturnList()

getContextContainer

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

setReturnValues

public int setReturnValues(NodeList nodes,
                           boolean trim)
                    throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

doStartTagHelper

public void doStartTagHelper()
                      throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

doEndTag

public void doEndTag()
              throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setNext

public void setNext()
             throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.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 java.lang.Object getCurrent()
Specified by:
getCurrent in interface ListProvider
Returns:
the current item in a list


MMBase build 1.7.1.20041002