Am 18.05.2011, 18:11 Uhr, schrieb Ralf Joachim <[email protected]>:

Hi Uwe,

as far as I recall you always have to specify the get-method even if you
only want a different set behaviour.


This makes a difference. Now the methods are called. If I use the

   public void addToLi(String item)

approach, the method is called for each item. Still

   public void updateLi(ArrayList<String> items)

is only called once with a list with one item instead of the
full list.

Now my problem is solved, but for me there are still open questions...

Thanks & Regards,

Uwe

Regards
Ralf

Am 18.05.2011 18:03, schrieb Uwe:
Am 18.05.2011, 17:58 Uhr, schrieb Uwe <[email protected]>:

Am 18.05.2011, 17:44 Uhr, schrieb Uwe <[email protected]>:

I added a method

    public void addLi(String s)
    {
        System.out.println("addToLi called with "+s);
        this.li.add(s);
    }

and the corresponding <field> in the mapping file is

       <field name="li" type="string" collection="arraylist"
set-method="addLi" />

During unmarshalling this function is never called, the list is not
unmarshalled
at all and I there is no thrown exception at all.

If I misspell addLi in the mapping file I get an extension that the
corresponding
method with the expected signature ist not found.


Further I tried another signature:

    public void updateLi(List<String> s)
    {
        System.out.println("updateLi called with "+s);
        this.li.addAll(s);
    }

and set the attribute "set-method" to "updateLi", but this
method is not called as the addLi method above.



Regards, Uwe






--
        
Dr. rer. nat. Uwe Schmitt
Forschung & Entwicklung Mathematik

mineway GmbH
Gebäude 4
Im Helmerswald 2
66121 Saarbrücken

Telefon: +49 (0)681 8390 5334
Telefax: +49 (0)681 830 4376

[email protected]
www.mineway.de

Geschäftsführung: Dr.-Ing. Mathias Bauer
Amtsgericht Saarbrücken HRB 12339

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

   http://xircles.codehaus.org/manage_email


Reply via email to