随笔分类 - JSON,XML
JSON,xml
摘要:JSON.toJSONString过程中出现实体类的属性与转换之前的顺序不一致public static void main(String[] args) { Person person = new Person(); person.setName("Tom"); person.setAge(20)
阅读全文
摘要:com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(sResult); jsonObject . getObject("key") get("key")
阅读全文
摘要:json解析的时候,通常顺序会发生改变,如果我们有保持原有顺序的需求的话可以通过如下方式 1、使用fastJson的Feature.OrderedField JSONObject respJson = JSONObject.parseObject(jsonStr, Feature.OrderedFi
阅读全文