I\'ve been facing this issue where, the hibernate objects on serialization produces unexpect xmls containing all the instrumented code from Hibernate.
We did some cleani
Haven't used it, but xstream-for-beans seems to fit (quoting):
This project provides implementation of mappers and converters that enhance XStream on following aspects:
- Serialize objects as they are exposed by getters and setters. XStream features available for fields shall work for properties defined for getter/setter proprerties.
- Sanitize serialization of managed objects: automatically omit irrelevant fields and class information.
- Handle "offline" fields and proxy objects.
I wrote once custom XStream Converter
s to deal with this issue, as a part of a closed-source project unfortunately. xstream-for-beans deals with the very same problems, well worth a shot.
I've used Terracotta's Pojoizer utility successfully in the past, but I don't think it's maintained anymore.