XML serialization of default values

P

Patrick

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top