This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Due to XStream's use of its registry of Converters, you've sometime need to know exactly how it behaves, namely, what class to put as the 2nd arugment in the alias method. This, I think, is arguably troublesome...
In order to make serialization always responsive to an object's getClass()'s response as the proper 2nd argument to the alias method, the idea-conductor is to subclass the ClassAliasingMapper. It can be condensed into the set up of the instantiation of the XStream (as shown) and this is how. (I call the subclass SelfDoc... for the responsiveness to .getClass() always, hence, do not need a priori accepting the behaviour of default converters... you may sure call it anything you like.)
You might have to change this to that according to the exact outcome your like better (such as getSimpleName() here, to getName() or getCanonicalName() etc etc..., choose what you feel more comfortable.)