首页 > 其他分享 >FastJson

FastJson

时间:2023-09-01 17:13:24浏览次数:43  
标签:FastJson 02 38 10 2023 12 24

1.JsonArray

[{"iSubdomainId":0,"iUpdate":0,"sHtDescription":"","sSourceId":1,"iSource":0,"iHour":0,"sSubdomainName":"","dHtDate":"","iOcLevel":0,"dCheckTime":"2023-02-24 12:38:10","iBuildProject":0,"sHtName":"","iOcNum":0,"iRepairType":0,"iMaintenance":0,"sReportUser":"","sUpdateTime":"2023-02-24 12:38:10","sDomainName":"","iId":0,"iOcWay":0,"dCreateTime":"2023-02-24 12:38:10","sUpdateUser":"","sCheckUser":"","iDomainId":0,"iMcId":0,"iHtId":0,"iHtType":0,"sMcName":""},{"iSubdomainId":0,"iUpdate":0,"sHtDescription":"","sSourceId":2,"iSource":0,"iHour":0,"sSubdomainName":"","dHtDate":"","iOcLevel":0,"dCheckTime":"2023-02-24 12:38:10","iBuildProject":0,"sHtName":"","iOcNum":0,"iRepairType":0,"iMaintenance":0,"sReportUser":"","sUpdateTime":"2023-02-24 12:38:10","sDomainName":"","iId":0,"iOcWay":0,"dCreateTime":"2023-02-24 12:38:10","sUpdateUser":"","sCheckUser":"","iDomainId":0,"iMcId":0,"iHtId":0,"iHtType":0,"sMcName":""},{"iSubdomainId":0,"iUpdate":0,"sHtDescription":"","sSourceId":3,"iSource":0,"iHour":0,"sSubdomainName":"","dHtDate":"","iOcLevel":0,"dCheckTime":"2023-02-24 12:38:10","iBuildProject":0,"sHtName":"","iOcNum":0,"iRepairType":0,"iMaintenance":0,"sReportUser":"","sUpdateTime":"2023-02-24 12:38:10","sDomainName":"","iId":0,"iOcWay":0,"dCreateTime":"2023-02-24 12:38:10","sUpdateUser":"","sCheckUser":"","iDomainId":0,"iMcId":0,"iHtId":0,"iHtType":0,"sMcName":""}]
        com.alibaba.fastjson.JSONArray jsonArray1 = JSON.parseArray(map.get("maintenanceData"));
        com.alibaba.fastjson.JSONArray jsonArray2 = com.alibaba.fastjson.JSONArray.parseArray(map.get("maintenanceData"));
        System.out.println(jsonArray1.size());
        System.out.println(jsonArray1);
        System.out.println(jsonArray2.size());
        System.out.println(jsonArray2);

标签:FastJson,02,38,10,2023,12,24
From: https://www.cnblogs.com/lwx11111/p/17672406.html

相关文章

  • fastjson2 打开 AutoType
    1.功能简介FASTJSON支持AutoType功能,这个功能在序列化的JSON字符串中带上类型信息,在反序列化时,不需要传入类型,实现自动类型识别。2.AutoType安全机制介绍必须显式打开才能使用。和fastjson1.x不一样,fastjson1.x为了兼容有一个白名单,在fastjson2中,没有任何白名单,也不包括......
  • Gson与FastJson详解
    Gson与FastJson详解Java与JSON做什么?将Java中的对象快速的转换为JSON格式的字符串.将JSON格式的字符串,转换为Java的对象.Gson将对象转换为JSON字符串转换JSON字符串的步骤:引入JAR包在需要转换JSON字符串的位置编写如下代码即可:Stringjson=newGson().toJSON(要转换的对象......
  • Gson与FastJson详解
    Gson与FastJson详解Java与JSON做什么?将Java中的对象快速的转换为JSON格式的字符串.将JSON格式的字符串,转换为Java的对象.Gson将对象转换为JSON字符串转换JSON字符串的步骤:引入JAR包在需要转换JSON字符串的位置编写如下代码即可:Stringjson=newGson().toJSON(......
  • FastJson不成想还有个版本2啊:序列化大字符串报错
    背景发现陷入了一个怪圈,写文章的话,感觉只有大bug或比较值得写的内容才会写,每次一写就是几千字,争取写得透彻一些,但这样,我也挺费时间,读者也未必有这么多时间看。我想着,日常遇到的小bug、平时工作中的一些小的心得体会,都还是可以写写,这样也才是最贴近咱们作为一线开发生活的,也不必......
  • spring web mvc 集成 fastjson2
    maven依赖参考文档https://github.com/alibaba/fastjson2/blob/main/docs/spring_support_cn.md<!-spring5使用这个-><dependency><groupId>com.alibaba.fastjson2</groupId><artifactId>fastjson2-extension-spring5</artifactId&......
  • fastjson对接口参数的某个字段不打印输出,如文件的base64字符串
    fastjson对接口参数的某个字段不打印输出,如文件的base64字符串packagecom.example.core.mydemo.json5;importcom.alibaba.fastjson.JSON;importcom.alibaba.fastjson.annotation.JSONField;/**需要提供getset方法,如果使用@Datalombok不生效(关键)**publicclassIte......
  • Gson与FastJson详解
    Gson与FastJson详解Java与JSON做什么?将Java中的对象快速的转换为JSON格式的字符串.将JSON格式的字符串,转换为Java的对象.Gson将对象转换为JSON字符串转换JSON字符串的步骤:引入JAR包在需要转换JSON字符串的位置编写如下代码即可:Stringjson=newGson().toJSON(要转换的对象......
  • fastjson反序列化 TODO
    参考链接fastjson反序列化入门文章https://tttang.com/archive/1579/https://xz.aliyun.com/t/12096ASM动态加载相关,如何查看内存生成的类的源码https://juejin.cn/post/6974566732224528392#heading-6https://blog.csdn.net/wjy160925/article/details/85288569关闭ASM去......
  • fastjson配置统一的日期格式转换
    importcom.alibaba.fastjson.serializer.SerializeConfig;importcom.alibaba.fastjson.serializer.SerializerFeature;importcom.alibaba.fastjson.serializer.ToStringSerializer;importcom.alibaba.fastjson.support.config.FastJsonConfig;importcom.alibaba.fast......
  • springboot~alibaba.fastjson2序列化时过滤字段
    当我们使用阿里的alibaba.fastjson2进行json序列化时,你可以通过方法参数PropertyFilter来实现对字段的获取,将需要序列化的字段写到PropertyFilter对象里,当然也可以将不进行序列化的写到这里,进行逻辑非操作即可实体classPerson{privateStringfirstName;privateStr......