How do I remove the class=”Something ” attributes in Xstream .
I use Xstream with annotations
I read its code and found if your class is not mapper.defaultImplementationOf(fieldType)
, it will add the default class attribute for you, unless the class attribute name is null;
So, set this can remove the class=”Something ” attributes
xstream.aliasSystemAttribute(null, "class");
This attribute is shown, at least, when it's not obvious which class shall be used. Usage of interface is an example. In situations like that You can try:
xStream.addDefaultImplementation(YourDefaultImplementation.class, YourInterface.class);
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With