
JSON
json
吾乃南华老仙
这个作者很懒,什么都没留下…
展开
-
FastJson自定义对象的反序列化逻辑
对要反序列化的类使用注解@JSONType,deserializer 属性表示自定义的反序列化对象@JSONType(deserializer = BusinessDataDeserializer.class)public class BusinessData { private String id; private Stirng name;}反序列化对象需要实现接口:ObjectDeserializerimport com.alibaba.fastjson.parser.deseriali原创 2020-12-15 10:40:50 · 1950 阅读 · 1 评论 -
Unable to evaluate the expression Method threw ‘net.sf.json.JSONException‘ exception.
Unable to evaluate the expression Method threw ‘net.sf.json.JSONException’ exception.JSON中存储的值是null,通过get()方法获取到值后,为空判断得到的结果居然是false对于不了解的同事来说:这个很坑… public static void main(String[] args) { String str = "{\"Content\":null}"; JSONObject j原创 2020-09-25 19:26:45 · 3418 阅读 · 2 评论