Moin Ralf,

or do you prefer any other special good morning statements in the
south of Germany?

Thanks for your help. Now, it works.
I changed the set-method description from setStyles(ArrayList<Style>
s) to addStyle(Style s) and castor use now the add method. ;)

Have a pleasant day.
Thomas



On 12/12/07, Ralf Joachim <[EMAIL PROTECTED]> wrote:
> Hi Thomas,
>
> if you implement following methods:
>
> ArrayList getStyles() {...}
> void addStyle(Style style) {...}
>
> and use a mapping like:
>
> <field name="styles" type="mypackage.Style"
>        collection="arraylist"
>        get-method="getStyles"
>        set-method="addStyle">
>   ...
> </style>
>
> castor should use the addStyle method to add values to the collection
> and use getStyles to get values from the collection. Having said that I
> do not know if I ever used that myself.
>
> An alternative would be to extend ArrayList with the intended behaviour.
>
> Regards
> Ralf
>
>
> Thomas Schoofs schrieb:
> > Hi Ralf,
> >
> > I believe I found the failure. Thank you for your Tip.
> > But this brings up my next question how I say castor to use the set or
> > add method?
> >
> > I add a System.out.println to the methods getStyles, setStyles and
> > addStyles. The effect was that the methods setStyles and addStyles
> > never called from the castor framework, but it calls 36 times the
> > getStyle method. In my example file are 35 styles defined and I
> > believe the last call is for the write out operation.
> >
> > If the list which is returned of the get- method is a class attribute
> > it works fine. In my case I create a new list in the method getStyle
> > and add the content of the differed style lists and in this case it
> > doesn't work.
> >
> > Is there any property which I have to set or what is the trick?
> >
> > Regards
> > Thomas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
>
> --
>
> Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
> Ralf Joachim
> Raiffeisenstraße 11
> 72127 Kusterdingen
> Germany
>
> Tel.   +49 7071 3690 52
> Mobil: +49 173 9630135
> Fax    +49 7071 3690 98
>
> Internet: www.syscon.eu
> E-Mail: [EMAIL PROTECTED]
>
> Sitz der Gesellschaft: D-72127 Kusterdingen
> Registereintrag: Amtsgericht Stuttgart, HRB 382295
> Geschäftsleitung: Jens Joachim, Ralf Joachim
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to