Dowemo

double converts to json, automatically assigns value 0. 0 to empty.
Handle:


JsonConfig jsonConfig = new JsonConfig();


jsonConfig.registerDefaultValueProcessor(Double.class, new DefaultDefaultValueProcessor() {


 public Object getDefaultValue(Class type) {


 return "";


 }


});//配置一个config,当double类型的数据为空的时候默认是空


JSONObject jsonOject =JSONObject.fromObject(personInfo,jsonConfig);









Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs