Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.3.1
-
Fix Version/s: None
-
Component/s: Annotations, Core
-
Labels:None
Description
When you have complex and deep object structures it would be nice to have an option
to omit all fields / whole classes from marshalling.
Or in other words:
To have a setting to marshall only mapped/annotated fields
(this should be not default setting - same as let's say Hibernate/annotations - only mapped fields are persisted).
That way you would not have to write and later maintain own converters.
Did anyone come across this XStream limitation?
Again, this is by design. XStream is a serialization tool, not a data binding tool. It is made to serialize Java objects to XML and back. It will write anything into XML that is necessary to recreate an equal object graph. The generated XML can be tweaked to some extend by configuration for convenience, but this is already an add-on. What you like to do can be done by implementing a custom mapper, but that's a question for the user's list and cannot be handled here.