Thomas,
You can control it, I've been using "add" methods for years now. Simply
add the set-method in the mapping file to be the add method:
<field name="child" type="Child"
collection="arraylist" set-method="addChild" get-method="getChild"/>
--Keith
Thomas Louis wrote:
>
> I found which method Castor calls, when it unmarshalls child-elements, that
> are mapped to an arraylist. It calls the get-method for the arraylist, so
> I've no control about making backreferences by Hand in an set-method. Thats
> not quite fine. Do I have to specify the set-method by hand in the
> mapping-file?
>
> > > public void addChild(Child child) {
> > > ...
> > > child.setParent(this);
> > > }
> >
> > Does this also work, if I unmarshall the data from XML. Which method does
> > the unmarshaller call to add childs? addChild(Child child)?
> setChild(Child[]
> > children)? setChild(int index, Child child)?
> >
> > Thank you,
> > Thomas
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev