Quintin Par Quintin Par -4 years ago 239
Java Question

Xstream: removing class attribute

How do I remove the class=”Something ” attributes in Xstream .

I use Xstream with annotations

Answer Source

Indeed the problem is not as clearly phrased as it should. My guess is that you are using a non-standard collection or using a field of an interface type for which XStream needs to store the actual class.

In the second case you can just use alias:

xstream.alias("field name", Interface.class, ActualClassToUse.class);

See http://markmail.org/message/gds63p3dnhpy3ef2 for more details.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download