Unsetting fields during in-place unmarshal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unsetting fields during in-place unmarshal

Jesse Glick
http://stackoverflow.com/questions/20668266/xstream-null-out-fields-not-mentioned-in-xml-during-in-place-unmarshal

Is this a bug in XStream? Or something that can be done easily and I
just missed it in documentation? Or something that would take
significant customization to implement?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Unsetting fields during in-place unmarshal

Jörg Schaible-2
Hi Jesse,

Jesse Glick wrote:

> http://stackoverflow.com/questions/20668266/xstream-null-out-fields-not-mentioned-in-xml-during-in-place-unmarshal
>
> Is this a bug in XStream? Or something that can be done easily and I
> just missed it in documentation? Or something that would take
> significant customization to implement?

XStream always sets only the elements that are present in XML. The fields of
uninitialized objects are always null. There is no code in XStream to
uninitialize fields if you provide an existing object as root. The only
alternative is currently a custom converter.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email