Xstream: removing class attribute

Quintin Par picture Quintin Par · Jan 5, 2010 · Viewed 14k times · Source

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

I use Xstream with annotations

Answer

Bleastrind picture Bleastrind · Apr 24, 2011

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");