com.cc.framework.taglib.forms
Class ForEachTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bycom.cc.framework.taglib.forms.ForEachTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class ForEachTag
extends javax.servlet.jsp.tagext.BodyTagSupport

Tag to iterate a collection of elements

Author:
P001002
See Also:
Serialized Form

Nested Class Summary
protected  class ForEachTag.FEIterator
          Wrapper for Iterator classes
protected  class ForEachTag.FEMapIterator
          Iterator for map collections
protected  class ForEachTag.FEOptionIterator
          Iterator for OptionList data models
protected static interface ForEachTag.ForEachIterator
          Iterator for the collection the tag should iterate through
 
Field Summary
private  java.lang.String indexId
          The name for the index property
protected  ForEachTag.ForEachIterator iterator
          Iterator of the elements of this collection, while we are actually running.
private  java.lang.String name
          The bean name of the collection
private  java.lang.String property
          The property name of the collection
private  HttpScope scope
          The scope where the collection is stored
private static long serialVersionUID
          Serial Version UID
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, 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
ForEachTag()
           
 
Method Summary
protected  ForEachTag.ForEachIterator createIterator()
           
 int doAfterBody()
          Make the next collection element available and loop, or finish the iterations if there are no more elements.
 int doEndTag()
           
 int doStartTag()
           
 java.lang.String getId()
           
 java.lang.String getIndexId()
           
protected  java.lang.Object lookupBean()
          Retrieves the bean which holds the Display Data or Control Instance
protected  int selectNext()
          This method selects the next element of the iteration
 void setIndexId(java.lang.String indexId)
          Sets the index id
 void setName(java.lang.String name)
          Specifies the name of the Java-Bean.
 void setProperty(java.lang.String property)
          Sets the Property-Attribute
 void setScope(java.lang.String scope)
          Sets the scope
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

iterator

protected ForEachTag.ForEachIterator iterator
Iterator of the elements of this collection, while we are actually running.


indexId

private java.lang.String indexId
The name for the index property


name

private java.lang.String name
The bean name of the collection


property

private java.lang.String property
The property name of the collection


scope

private HttpScope scope
The scope where the collection is stored

Constructor Detail

ForEachTag

public ForEachTag()
Method Detail

lookupBean

protected java.lang.Object lookupBean()
                               throws javax.servlet.jsp.JspException
Retrieves the bean which holds the Display Data or Control Instance

Returns:
Bean (Control instance or DataModel)
Throws:
javax.servlet.jsp.JspException - Is thrown when the bean could not be found

createIterator

protected ForEachTag.ForEachIterator createIterator()
                                             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Make the next collection element available and loop, or finish the iterations if there are no more elements.

Throws:
javax.servlet.jsp.JspException
See Also:
BodyTagSupport.doAfterBody()

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doEndTag()

selectNext

protected int selectNext()
This method selects the next element of the iteration

Returns:
returns EVAL_BODY_BUFFERED when there was a valid iteration element and SKIP_BODY otherwise

setName

public void setName(java.lang.String name)
             throws javax.servlet.jsp.JspException
Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

Parameters:
name - Name of the Bean
Throws:
javax.servlet.jsp.JspException

setProperty

public void setProperty(java.lang.String property)
                 throws javax.servlet.jsp.JspException
Sets the Property-Attribute

Parameters:
property - The Property-Attribute
Throws:
javax.servlet.jsp.JspException

setIndexId

public void setIndexId(java.lang.String indexId)
                throws javax.servlet.jsp.JspException
Sets the index id

Parameters:
indexId - index id
Throws:
javax.servlet.jsp.JspException

setScope

public void setScope(java.lang.String scope)
              throws javax.servlet.jsp.JspException
Sets the scope

Parameters:
scope - Scope
Throws:
javax.servlet.jsp.JspException - If the Argument can't be converted to HttpScope

getId

public java.lang.String getId()
See Also:
TagSupport.getId()

getIndexId

public java.lang.String getIndexId()
Returns:
returns the name for the iteration index


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.