Hi Stephen,
"serialPersistentFields" is the approach I was talking about. Here's an example:
http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/examples.html
You customize how the object is serialized and deserialized by adding
callback methods to it, readObject and writeObject - JSX will call
these. Within these, you can use the serialPersistentFields (an array
that defines the class's fields for the purposes of serialization - so
they can differ from the actual fields of the class), and GetField and
PutField to read/write them.
So, you can customize how fields are read in, with these virtual
fields that you can process in whatever way you need to before
assigning the values to fields. For serialization, you can write out
the fields as normal.
I recommend having a play around with this. You can use this as a
migration mechanism, to read in the old version and write out the new.
You can inspect the XML to verify it has made the change you intended
to make.
For simple changes, it may be easier to modify the XML directly.
Note: for primitive type changes, JSX automatically converts them to
the expected type.
Here's the JOS spec.
http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/serialTOC.html
BTW: There's only one change to serialization in Java 1.6 (very esoteric):
http://java.sun.com/javase/6/docs/technotes/guides/serialization/relnotes6.html
cheers,
Brendan