Class ListTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.AbstractBeanTag
-
- net.sf.jguiraffe.gui.builder.di.tags.CollectionTag
-
- net.sf.jguiraffe.gui.builder.di.tags.ListTag
-
- All Implemented Interfaces:
org.apache.commons.jelly.Tag
public class ListTag extends CollectionTag
A specialized
CollectionTag
implementation for creating lists.With this tag handler class list objects can be created that can be passed to other tags supporting a value (the tag can be placed in the body of each tag handler class derived from
DependencyTag
). Alternatively, thename
attribute can be specified; in this case the list bean can be directly queried from the current bean store using this name. The content of the list is defined byElementTag
tags in the body of this tag. It is possible to define the type of the list elements as attributes. Alternatively theElementTag
tags can have a class definition, which will override the one set at this tag.The following example fragment shows how this tag can be used to define a list that will be passed as an argument of a constructor invocation:
<constructor> <param> <list elementClassName="java.lang.Integer"> <element value="1"/> <element value="2"/> <element value="3"/> </list> </param> </constructor>
ListTag
supports the following attributes:Attribute Description Optional name Using this attribute a name for the list bean can be specified. The bean can then be queried from the current bean store by this name. If no name is provided, an anonymous bean is created; in this case the tag must be nested in the body of a DependencyTag
.yes elementClass Here the class of the elements contained can be specified. When elements are added, the tag will try to convert the objects to this class if necessary. If an ElementTag
in the body of this tag defines a value class, this class will be used thus overriding the element class specified at the collection level. If neither the collection tag nor the element tag specifies a class, no type conversion will be performed.yes elementClassName This attribute has the same effect as elementClass
, but the name of the element class is specified rather than the class object itself.yes elementClassLoader If the name of the element class is specified, with this attribute a class loader for resolving the class can be defined. The name specified here will be passed to the current ClassLoaderProvider
for obtaining the desired class loader.yes - Version:
- $Id: ListTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ListTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanProvider
createBeanProvider()
Creates the bean provider representing the collection managed by this tag.-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.CollectionTag
addElement, getElementClassData, getElementClassDesc, getElementDependencies, getName, processBeforeBody, setElementClass, setElementClassDesc, setElementClassLoader, setElementClassName, setName
-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.AbstractBeanTag
doTag, getBeanStoreTag, getStore, getTargetDependency, isAnonymous, process, setBeanStoreTag, setStore, store
-
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
-
-
-
-
Method Detail
-
createBeanProvider
protected BeanProvider createBeanProvider() throws org.apache.commons.jelly.JellyTagException
Creates the bean provider representing the collection managed by this tag. This implementation will create aListBeanProvider
object.- Specified by:
createBeanProvider
in classAbstractBeanTag
- Returns:
- the bean provider produced by this tag
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
-