org.apache.commons.jelly.tags.core
Class UseListTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.DynaTagSupport
          extended byorg.apache.commons.jelly.MapTagSupport
              extended byorg.apache.commons.jelly.tags.core.UseBeanTag
                  extended byorg.apache.commons.jelly.tags.core.UseListTag
All Implemented Interfaces:
BeanSource, CollectionTag, DynaTag, Tag

public class UseListTag
extends UseBeanTag
implements CollectionTag

A tag which creates a List implementation and optionally adds all of the elements identified by the items attribute. The exact implementation of List can be specified via the class attribute

Version:
$Revision: 155420 $
Author:
James Strachan

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
UseListTag()
           
 
Method Summary
 void addItem(java.lang.Object value)
           
 java.lang.Class getAttributeType(java.lang.String name)
           
protected  java.lang.Class getDefaultClass()
          Allows derived classes to provide a default bean implementation class
 java.util.List getList()
           
protected  void processBean(java.lang.String var, java.lang.Object bean)
          By default this will export the bean using the given variable if it is defined.
protected  void setBeanProperties(java.lang.Object bean, java.util.Map attributes)
          Sets the properties on the bean.
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, convertToClass, doTag, getBean, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, newInstance, setBean, setIgnoreUnknownProperties, validateBeanProperties
 
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes, setAttribute
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Constructor Detail

UseListTag

public UseListTag()
Method Detail

getList

public java.util.List getList()

addItem

public void addItem(java.lang.Object value)
Specified by:
addItem in interface CollectionTag
Returns:
adds an item to the tags collection

getAttributeType

public java.lang.Class getAttributeType(java.lang.String name)
                                 throws JellyTagException
Specified by:
getAttributeType in interface DynaTag
Overrides:
getAttributeType in class DynaTagSupport
Returns:
the type of the given attribute. By default just return Object.class if this is not known.
Throws:
JellyTagException

setBeanProperties

protected void setBeanProperties(java.lang.Object bean,
                                 java.util.Map attributes)
                          throws JellyTagException
Description copied from class: UseBeanTag
Sets the properties on the bean. Derived tags could implement some custom type conversion etc.

This method ignores all property names in the Set returned by UseBeanTag.getIgnorePropertySet().

Overrides:
setBeanProperties in class UseBeanTag
Throws:
JellyTagException

processBean

protected void processBean(java.lang.String var,
                           java.lang.Object bean)
                    throws JellyTagException
Description copied from class: UseBeanTag
By default this will export the bean using the given variable if it is defined. This Strategy method allows derived tags to process the beans in different ways such as to register this bean with its parent tag etc.

Overrides:
processBean in class UseBeanTag
Throws:
JellyTagException

getDefaultClass

protected java.lang.Class getDefaultClass()
Description copied from class: UseBeanTag
Allows derived classes to provide a default bean implementation class

Overrides:
getDefaultClass in class UseBeanTag


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.