Class UseListTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- org.apache.commons.jelly.DynaTagSupport
-
- org.apache.commons.jelly.MapTagSupport
-
- org.apache.commons.jelly.tags.core.UseBeanTag
-
- org.apache.commons.jelly.tags.core.UseListTag
-
- All Implemented Interfaces:
DynaTag
,BeanSource
,CollectionTag
,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, parent
-
-
Constructor Summary
Constructors Constructor Description UseListTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(Object value)
adds an item to the tags collectionClass
getAttributeType(String name)
protected Class
getDefaultClass()
Allows derived classes to provide a default bean implementation classList
getList()
protected void
processBean(String var, Object bean)
By default this will export the bean using the given variable if it is defined.protected void
setBeanProperties(Object bean, 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
-
-
-
-
Method Detail
-
getList
public List getList()
-
addItem
public void addItem(Object value)
Description copied from interface:CollectionTag
adds an item to the tags collection- Specified by:
addItem
in interfaceCollectionTag
-
getAttributeType
public Class getAttributeType(String name) throws JellyTagException
- Specified by:
getAttributeType
in interfaceDynaTag
- Overrides:
getAttributeType
in classDynaTagSupport
- Returns:
- the type of the given attribute. By default just return Object.class if this is not known.
- Throws:
JellyTagException
-
setBeanProperties
protected void setBeanProperties(Object bean, 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 classUseBeanTag
- Throws:
JellyTagException
-
processBean
protected void processBean(String var, 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 classUseBeanTag
- Throws:
JellyTagException
-
getDefaultClass
protected Class getDefaultClass()
Description copied from class:UseBeanTag
Allows derived classes to provide a default bean implementation class- Overrides:
getDefaultClass
in classUseBeanTag
-
-