> > 2) When a child is created, the parent element is on the 
> sax-stack. Castor
> > could use that information and call the setParent() method with the
> > reference from the stack. There could be a definition like
> 
> This would have to be implemented in Castor.
> However, it would mean adding more 'magic' to Castor, which already
> has quite a good portion of it.
> 
> > But how can I tell castor to use the addChild() method? Setting the
> > set-method attribute of the children-field element does not work,
> > because castor seems to ignore the set-method if the field is a
> > collection. Castor seems to call the get-method and add any new
> > child directly to the collection.
> 
> This works perfectly in our application. Here's an example 
> excerpt from our mapping file:
> 
>               <field name="NodeList"
>                       type="com.skynamics.prisma.core.process.Node"
>                       collection="collection"
>                       get-method="getNodeList"
>                       set-method="addNode">
>                       <bind-xml name="node"/>
>               </field>
> 
> Castor will use the addNode method to add new elements.
> Note that the method name must start with 'add' in order to 
> be regonized as
> single element add method and not as list setter.
> 

Thats true. Thank you very much, Heiko. I tried it before, but there must
have been a typo.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to