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