Jython is great for creating custom data structures on need basis, but how to store their instances? Apparently it's possible to do it via java.io.Serializable
, but ObjectStreams
are not human readable; I would prefer XML.
I naïvely tried XStream to serialize a simple object created in Jython and translated to Java with PyObject
's __tojava__
method, but the result was, expectedly, pretty much gibberish because of XStream's heavy use of reflection (it finds all Jython's internals) - and deserialization doesn't work (maybe because of Jython's dynamically loaded proxy classes or some other implementation details that I'm really not familiar with.)
Is there anything like XStream for Jython objects - perhaps a Jython library?