Java classes may define a specialized serialization (see JavaDoc for
Serializable) by defining two methods:
private void writeObject(ObjectOutputStream out) throws IOException
private void readObject(ObjectInputStream in) throws IOException
XStream is not capable of handling these cases.
A simple usecase:
public class SpecialClass {
protected transient String[] array = ...
private void writeObject( ObjectOutputStream out ) {
// do something special with "array" here (i.e. encrpyt it)
// and write to "out"
}
}
XStream does not look at "array" because it's transient, but does also not treat writeObject(), so a serialized object of SpecialClass will be empty.
The website changelog reads:
for the latest snapshot. Does the snapshot implementation solve the problem you mentioned?
Thanks,
Gili