Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > XML serialization of default values

Reply
Thread Tools

XML serialization of default values

 
 
Patrick
Guest
Posts: n/a
 
      04-13-2004
I've been trying to serialize Java objects to XML using both Java's
serialization framework and Castor. I've found that in both cases,
only the non-default values are written to XML. I need the default
values to be serialized also, so that in case those values change in
the future, I'll be able to read in what they were at the time.
Additionally, the amount of data I'm serializing makes it impractical
to write code to serialize each object individually, so I need
something that uses reflection.

How do people handle this? Is there a library which does this?
 
Reply With Quote
 
 
 
 
analogueboy
Guest
Posts: n/a
 
      04-14-2004
have a look at http://xstream.codehaus.org, I've used this a little and
found that it is very easy to get set up and runs pretty quickly too.

HTH


"Patrick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I've been trying to serialize Java objects to XML using both Java's
> serialization framework and Castor. I've found that in both cases,
> only the non-default values are written to XML. I need the default
> values to be serialized also, so that in case those values change in
> the future, I'll be able to read in what they were at the time.
> Additionally, the amount of data I'm serializing makes it impractical
> to write code to serialize each object individually, so I need
> something that uses reflection.
>
> How do people handle this? Is there a library which does this?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to move from java object serialization to xml serialization? Dimitri Ognibene Java 4 09-02-2006 07:32 AM
Object serialization XML vs java serialization plasticfloor@gmail.com Java 3 06-14-2006 03:45 AM
Serialization Problems and books on serialization? sinleeh@hotmail.com Java 8 01-02-2005 02:40 PM
avoiding XML serialization, different WSDL generation, soap serialization Ramunas Urbonas ASP .Net Web Services 1 07-27-2004 09:57 PM
[XML] filling empty attribute values with the default value specifiedin the XML schema. Stefan Siegl Java 1 07-28-2003 06:18 PM



Advertisments