You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bruno Dusausoy <bd...@yp5.be> on 2010/07/14 11:50:43 UTC

Cxf-codegen-plugin and collection setter

Hi,

Is there a way to integrate the JAXB 2.1 Collection setter injection
plugin[1] to cxf-codegen-plugin ?

Regards.

[1] https://jaxb2-commons.dev.java.net/collection-setter-injector/
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Re: Cxf-codegen-plugin and collection setter

Posted by Aleksei Valikov <al...@gmail.com>.
Hi,

>> Please file an issue, I'll consider it in the next release.
>>
> Done : http://jira.highsource.org/browse/JIIB-20
> Maybe I'll look at the code and send a patch, but don't take it for
> granted as I don't have much spare time :-/.

Don't worry, it's a trivial issue, no need for a patch.

Bye.
/lexi

Re: Cxf-codegen-plugin and collection setter

Posted by Bruno Dusausoy <bd...@yp5.be>.
On Wed, 14 Jul 2010 14:11:33 +0200, Aleksei Valikov
<al...@gmail.com> wrote:
> Hi,
> 
>> Any idea ?
> 
> Please file an issue, I'll consider it in the next release.
> 
Done : http://jira.highsource.org/browse/JIIB-20
Maybe I'll look at the code and send a patch, but don't take it for
granted as I don't have much spare time :-/.

Regards.
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Re: Cxf-codegen-plugin and collection setter

Posted by Aleksei Valikov <al...@gmail.com>.
Hi,

> Any idea ?

Please file an issue, I'll consider it in the next release.

Bye.
/lexi

Re: Cxf-codegen-plugin and collection setter

Posted by Bruno Dusausoy <bd...@yp5.be>.
On Wed, 14 Jul 2010 12:42:21 +0200, Aleksei Valikov
<al...@gmail.com> wrote:

[...]
> You can use the Setters plugin from JAXB2 Basics:
> 
>
http://confluence.highsource.org/display/J2B/Using+JAXB2+Basics+Plugins+with+CXF
> 

Works nearly well ;).
Indeed, I've added the plugin just as described in the documentation you
pointed out but it turns out that the generated class uses addAll() method
on the collection instead of assigning it :

    public void setPersonQuarter(List<PersonQuarterStruct> value) {
        List<PersonQuarterStruct> draftl = this.getPersonQuarter();
        draftl.addAll(value);
    }

I'd rather prefer 

    public void setPersonQuarter(List<PersonQuarterStruct> value) {
        this.getPersonQuarter = value;
    }

instead.

I've searched the net but haven't found any configuration param I could
use in order to change this behaviour.
Any idea ?

Regards.
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Re: Cxf-codegen-plugin and collection setter

Posted by Aleksei Valikov <al...@gmail.com>.
Hi

> Is there a way to integrate the JAXB 2.1 Collection setter injection
> plugin[1] to cxf-codegen-plugin ?
>
> [1] https://jaxb2-commons.dev.java.net/collection-setter-injector/

You can use the Setters plugin from JAXB2 Basics:

http://confluence.highsource.org/display/J2B/Using+JAXB2+Basics+Plugins+with+CXF

Bye.
/lexi