0X00 先来一下SerializerFeature的源码吧。 /** Copyright 1999-2101 Alibaba Group.** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the Lice
最近碰到一个接口对接需要将jsonarray集合转换为List指定实体集合的情况,我使用的是阿里的fastjson工具包,操作很简单,具体的代码如下://开始解析数据JSONArray array = JSON.parseArray(result.get("data").toString());//遍历其中的数据List<CheckingInfo> checkinList = new Ar
构造了一个稍微复杂的Java对象对比在不同情况下的转换效率,都是循环20次执行。 项目地址:https://gitee.com/icefire11/test-fast-json 概述: Main方法示例: import com.alibaba.fastjson.JSONObject;public class Test {public static void main(String[] ar
首先要说的是FastJson提供了一个用于处理泛型反序列化的类TypeReference,在知道具体泛型类型的情况下可以实现反序列化,这里由于应用场景不适用不对其进行讨论。 如下场景: public class PieChartVO<T extends BaseDebtVO> implements Serializable {private static final long serial