java - Object to Json including only fields not null -


i have object named item plenty of fields. i'm using java json (json-io) library serialize state in file:

string json = jsonwriter.objecttojson(item); // write string file 

i'd make json string less verbose not include null values (if possible boolean false). possible somehow ?
thanks

i can recommend using jackson mapper if possible. check out these 2 questions:

jackson serialization: ignore empty values (or null)

how tell jackson ignore field during serialization if value null?


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -