Hello Jörg,

Thank you for your quick and clear answer.

I am trying to migrate an existing code base from JAXB to XStream, to
compare the unmarshalling speed and the ease of use of both frameworks.
Currently our JAXB annotations use the accessors. I wanted to do the same
in XStream in case some of the accessors have some extra logic in it and
also to make the benchmark as fair as possible.

I will review our accessors and if none of them do anything special, I
guess accessing the fields directly is not a big issue.

Thanks again,

LP


On Thu, May 15, 2014 at 5:27 PM, Jörg Schaible <joerg.schai...@swisspost.com
> wrote:

> Hello LP,
>
> Lethal Possum wrote:
>
> > Hello everyone,
> >
> > I am a new to XStream user and I have an issue that might be very simple
> > but I am not able to figure it out.
> >
> > Let's say I have the following XML:
> >
> > <main id="foo">
> >    <name>bar</name>
> > </main>
> >
> > I would like to use the JavaBeanConverter to force the unmarshalling to
> go
> > through my setters but when I register the JavaBeanConverter, my
> > XStreamAsAttribute annotations seem to stop working.
>
> [snip]
>
> > With the JavaBeanConverter registered, I see the print message in
> > setName() but not the one in setId() and the id field remains null. If I
> > comment it out, I do not go through the setters but id's value is
> correct.
> > What am I missing?
>
> The current implementation for the attribute support (and other stuff) is
> completely based on reflection. Therefore the JavaBeanConverter has
> currently no support for attributes, since the property name of a bean does
> not have to correspond in any way with the internal field name of a member
> of the bean. Sorry.
>
> Unfortunately this is nothing we can change in short time, since it
> requires
> a most-probably incompatible redesign of the registration and lookup part.
>
> > Thanks in advance for your help.
>
> What do you try to achieve with the calling of the setters?
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to