org.apache.struts.taglib.bean
Class SizeTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.struts.taglib.bean.SizeTag
All Implemented Interfaces:
Serializable, IterationTag, Tag
Direct Known Subclasses:
NestedSizeTag

public class SizeTag
extends TagSupport

Define a scripting variable that will contain the number of elements found in a specified array, Collection, or Map.

Version:
$Rev: 471754 $ $Date: 2004-10-16 12:38:42 -0400 (Sat, 16 Oct 2004) $
See Also:
Serialized Form

Field Summary
protected  Object collection
          The actual collection to be counted.
protected  String id
          The name of the scripting variable that will be exposed as a page scope attribute.
protected static org.apache.struts.util.MessageResources messages
          The message resources for this package.
protected  String name
          The name of the bean owning the property to be counted.
protected  String property
          The name of the property to be retrieved.
protected  String scope
          The scope within which to search for the specified bean.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
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
SizeTag()
           
 
Method Summary
 int doStartTag()
          Retrieve the required property and expose it as a scripting variable.
 Object getCollection()
           
 String getId()
           
 String getName()
           
 String getProperty()
           
 String getScope()
           
 void release()
          Release all allocated resources.
 void setCollection(Object collection)
           
 void setId(String id)
           
 void setName(String name)
           
 void setProperty(String property)
           
 void setScope(String scope)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

protected static org.apache.struts.util.MessageResources messages
The message resources for this package.


collection

protected Object collection
The actual collection to be counted.


id

protected String id
The name of the scripting variable that will be exposed as a page scope attribute.


name

protected String name
The name of the bean owning the property to be counted.


property

protected String property
The name of the property to be retrieved.


scope

protected String scope
The scope within which to search for the specified bean.

Constructor Detail

SizeTag

public SizeTag()
Method Detail

getCollection

public Object getCollection()

setCollection

public void setCollection(Object collection)

getId

public String getId()
Overrides:
getId in class TagSupport

setId

public void setId(String id)
Overrides:
setId in class TagSupport

getName

public String getName()

setName

public void setName(String name)

getProperty

public String getProperty()

setProperty

public void setProperty(String property)

getScope

public String getScope()

setScope

public void setScope(String scope)

doStartTag

public int doStartTag()
               throws JspException
Retrieve the required property and expose it as a scripting variable.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Throws:
JspException - if a JSP exception has occurred

release

public void release()
Release all allocated resources.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.