[xstream-user] nillable option

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

[xstream-user] nillable option

RoshanP
Hi,

Is there anyway to set an option in xstream so that all properties are
displayed, even if they are not set? So if I had a property foo, that was not
set, it would print out the xml <foo/> ? Thanks.

Roshan

Reply | Threaded
Open this post in threaded view
|

Re: [xstream-user] nillable option

Joe Walnes-2
On 11/8/05, Roshan Punnooser <[hidden email]> wrote:
> Is there anyway to set an option in xstream so that all properties are
> displayed, even if they are not set? So if I had a property foo, that was not
> set, it would print out the xml <foo/> ? Thanks.

Hi Roshan

There is no option to do this.

The reason behind this is that upon deserialization, XStream would not
know whether <foo/> should be restored as null value or an empty
instance. For example, if foo was a string it could be null or "",
which mean entirely different things.

Sorry it's not the answer you're looking for.

thanks
-Joe