users@jaxb.java.net

Re: missing setWhatever()

From: Robert Lowe <rmlowe_at_rmlowe.com>
Date: Fri, 28 Mar 2003 03:10:12 +0800

I'm no expert, but I'm guessing it's to do with controlling what List
implementation is used. I know that the RI uses its own List implementation
internally--presumably this is something to do with fail-fast validation
checking.

I guess that means that if there *was* a setter method then it would have to
copy the List internally, so the behaviour might not be what you'd expect.
(Both in terms of performance, and subsequent modifications to the Lists.)

JDOM does something similar--you can set List properties, but the lists are
actually copied internally into a JDOM-specific List implementation.


----- Original Message -----
From: "Malachi de AElfweald" <malachi_at_EOTI.ORG>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Friday, March 28, 2003 2:46 AM
Subject: Re: missing setWhatever()


> On Fri, 28 Mar 2003 02:10:43 +0800, Robert Lowe <rmlowe_at_rmlowe.com> wrote:
>
> >JAXB will never generate setters for Lists. You don't need them because
the
> >List returned by the getter is mutable--just call the getter and modify
the
> >List it returns.
>
> Hmmm. Ok, I can work with that. Not very intuitive though. Wasn't the
standard for get/set started back with the JavaBeans stuff? Personally, I
think there should be a set method, so that the API is consistent. But, as
I said, I can work around that.
>
> Malachi