You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2009/10/29 22:16:03 UTC

Read-only data

I've got an object with some internal state. I want the state to travel
across the wire to a client, and come back, but I don't want a public
setter.

Is there a way of using JAXB annotations to achieve this?

Re: Read-only data

Posted by Daniel Kulp <dk...@apache.org>.
On Thu October 29 2009 5:16:03 pm Benson Margulies wrote:
> I've got an object with some internal state. I want the state to travel
> across the wire to a client, and come back, but I don't want a public
> setter.
> 
> Is there a way of using JAXB annotations to achieve this?

I THINK if you use the @XmlAccessorType(XmlAccessType.FIELD) annotation  on 
the class and then stick the @XmlElement and stuff annotations on the fields 
instead of the methods, then JAXB pretty much will ignore the getter/setter 
things and directly inject via the fields.    



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog