commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daryl Stultz" <>
Subject RE: [jelly] parent and child tags
Date Mon, 08 Mar 2004 20:06:52 GMT
"Jakarta Commons Users List" <> writes:
>I like the way you worded that.  I "discovered" it too.  ;-)
>This really needs to go into the documentation if it is in fact the best
>to do this.

I agree. I found it via the API docs.
>Yes, that would certainly work.  I'm just thinking that if I have an
>with 20 different child elements, I don't want to create a class for each
>the child elements and have to tell each one to pass its data up to the

Well, you still have to create a class for each child element, don't you?
You need something to operate on the tag.

I would think all the parent/child handling code could go in a single
superclass tag or an interface with an operator class to do the passing,
rather than reimplementing it in each child tag.

>  I guess what I really want is a way to treat child elements like
>attributes are treated ... set methods are automatically called.  For
>example, I want
>  <bar>7</bar>
>to result in creation of a foo object and the call foo.setBar(7).

In this case, bar is an element/object, not an attibute/primitive value,
so the above code should not call foo.setBar(7). It would be identical to
<foo bar="7" />.
Maybe what you want is the parent tag to automatically maintain a list of
its children and then provide access to the child tags/beans. While I
don't like wasting a superclass (super to Foo but sub of TagSupport) it
would be easy enough to implement this for you own work (if/until the
Jelly folks add the feature).

Daryl Stultz
6 Degrees Software and Consulting, Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message