I do think forEach makes sense with collections and I do believe it is kind of sad to expect a collection out of a... string-object... so I would really prefer having something like core:forEachTokens with good attributes like the token-list, wether to go through tokens... and possibly with other attributes like token-family names (e.g. any whitespace, any character, any capital, as java.lang.Character offers).
Thanks.
Paul
On 16-Dec-03, at 1:12 Uhr, Scott Walters wrote:
I took a quick look at the forEach tag code from org.apache.commons.jelly.tags.core and I think this is the part where it figures out to do with your items parameter...
From the evaluateAsIterator function in org.apache.commons.jelly.expression.ExpressionSupport
if ( value instanceof Iterator ) { return (Iterator) value; } else if ( value instanceof List ) { List list = (List) value; return list.iterator(); } else if ( value instanceof Map ) { Map map = (Map) value; return map.entrySet().iterator(); } else if ( value.getClass().isArray() ) { return new ArrayIterator( value ); } else if ( value instanceof Enumeration ) { return new EnumerationIterator((Enumeration ) value); } else if ( value instanceof Collection ) { Collection collection = (Collection) value; return collection.iterator();
To use a comma delimited list, you would have to parse it into an array first with something like the split function from the java.lang.String class.
Scott
Amnon Khen wrote:Hi all,
I sent a question about jelly core:forEcah collection almost a week ago and
no one has answered me.
Is my question off-topic? Is it a newbie question? I tried looking up the
answer myself before posting a message here and haven't found anything...
Please help... :)
Thanks,
Amnon
______________________________________________________________________
Amnon Khen, Configuration Management, Cash-U Mobile Technologies LTD. Mobile: +972-(0)54-922394 / Office: +972-(0)9-8920815
mailto:[EMAIL PROTECTED] / http://www.cash-u.com
Israel - 45 Hamelacha St., P.O. Box 8617, New Industrial Zone, Netanya
36880, Israel / Tel: +972 9 8920888 Europe - Argentum, 2 Queen Caroline St., Hammersmith, London W6 9DT, UK /
Tel: +44 20 8323 8066
Asia-Pacific - 47A Duxton Road, Singapore 089511 / Tel: +65 67322440
______________________________________________________________________
This e-mail message and its attachments are for the sole use of the intended
recipient(s), may contain confidential and/or privileged information and are
to be regarded as confidential information under any non disclosure
agreement. Any review, use, disclosure or distribution by persons or
entities other than the intended recipient(s) is prohibited. If you are not
the intended recipient, please contact the sender by reply and destroy all
copies of the original message and its attachments.
______________________________________________________________________
-----Original Message-----
From: Amnon Khen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 17:49
To: '[EMAIL PROTECTED]'
Subject: core:forEach collections
Hi Jelly folk,
What types of collections can be used in the core:forEach tag?
In the ForEach task from ant-contrib, one can use delimited strings as well
as Ant data types like Path-like Structures. Can this also be simply
achieved in Jelly?
I'm thinking about something in the neighborhood of:
<c:forEach ...>
<c:list>
...
</c:list>
</c:forEach>
I can always create a path and convert it into a delimited string the
PathConvert task, but it's a bit tedious. It won't kill me, of course...
Is there a way to group properties in to a set similarly to the PropertySet
data type in Ant 1.6?
Thanks for your time and consideration,
Amnon
______________________________________________________________________
Amnon Khen, Configuration Management, Cash-U Mobile Technologies LTD. Mobile: +972-(0)54-922394 / Office: +972-(0)9-8920815
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> /
http://www.cash-u.com <http://www.cash-u.com/> Israel - 45 Hamelacha St., P.O. Box 8617, New Industrial Zone, Netanya
36880, Israel / Tel: +972 9 8920888 Europe - Argentum, 2 Queen Caroline St., Hammersmith, London W6 9DT, UK /
Tel: +44 20 8323 8066
Asia-Pacific - 47A Duxton Road, Singapore 089511 / Tel: +65 67322440
______________________________________________________________________
This e-mail message and its attachments are for the sole use of the intended
recipient(s), may contain confidential and/or privileged information and are
to be regarded as confidential information under any non disclosure
agreement. Any review, use, disclosure or distribution by persons or
entities other than the intended recipient(s) is prohibited. If you are not
the intended recipient, please contact the sender by reply and destroy all
copies of the original message and its attachments.
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
