Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top