Ant does not use setMyAttr(SomeType) for nested elements, just for
attributes, and requires a SomeType(String) Ctor when an 'myattr' attribute
is found.

What you are referring to is addMyElem(MyElemClass) which does use the
default MyElemClass default Ctor when seeing a nested <myelem> element. Or
as James pointed out, use MyElemClass createMyElem(), to enable
polymorphism. --DD

-----Original Message-----
From: James Strachan [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 20, 2003 11:57 AM
To: Jakarta Commons Users List
Subject: Re: [jelly] taglib implementation questions

From: "Christian Sell" <[EMAIL PROTECTED]>
> BTW, the BeanTagLibrary seems to also require that objects implement
> createXX methods for nested elements. Why cant the object type simply be
> inferred from the argument of the setXX method, and the object be
> created by the default constructor? I think that is what Ant does.

AFAIK Ant uses similar kinds of createXX() methods.

>From a given tag <foo> its not always obvious what class needs to be
invoked. Though there's nothing to stop you writing your own tag -> bean
protocol so to speak.

James

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to