简体   繁体   中英

Ignore some fields of xml using Xstream

I want to know if I can ignore fields using this method xstream.omitField(Class.class, "cUF"); because I have a list of fields to ignore, in the same class so how can I do that?

I´m using xStream

Thanks

Maybe there are some fields that contains null values, I had the same problem, and What I made the conclusion that Xstream try to access directly to the fields value, I mean it does not acces by setter or getter, try something, before of make your xml, set to a empty String the field : ""

object.setField("");

If it does not working, try to set the field in an empty String in the class constructor, just fro trying, if with that appers the field in your XML you have an idea where your problem could be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM