collection:string
This is a usefull tag if you wan to convert a Collection
eiter to or from a String
. It can do both. This is decided by the method
attribute.
If the operation is split
you can choose the type of object to be returned. This is done by the type
attribute.
Syntax
<collection:string delimiter="..."? id="..."? keyValueDelimiter="..."? method="..."? name="..."? property="..."? type="..."? value="..."?/>
Attributes
id
Name of the
String
orCollection
that is returned from this tag. This is determined by themethod
attribute.value
The object to convert. This must be of the correct type acording to current method.
name
The key value to look up an existing bean. There is two ways of using this bean.
Either the bean must be of type
collection
orString
. This depends on which type of operation you intend to do.Or the bean must have a property to get the wanted object. Then the attribute
property
must be used.Using this attribute excludes the use of the
value
attribute.property
Identifies the JavaBeans property (of the bean identified by the
name
attribute) to get the Object to be used by the tag. If not specified, the bean identified by thename
attribute itself will be used as the value.method
This attribute will define the usage of this tag.
Valid values:
If set to
split
it will take aString
, split it and then add all items into theCollection
. If it is set tomerge
the tag will take the specifiedCollection
and merge all itemes into aString
.type
Will define what type of
Collection
the tag will return. You can either specify the class or just type eithercollection
ormap
.If you specify a class is must be an instance of
java.util.Collection
orjava.util.Map
This attribute is only in use when
method
is set tosplit
.delimiter
What delimiter to be used to separate to elements when converting a
collection
to aString
.If not specified the default value will be used. The default value is ,
keyValueDelimiter
This delimiter will only be used when converting a
String
to aMap
. It is used to separate thekey
/value
pair.If not specified will the default value be used. The default value is =