JSON库很常用了,现在开源的JSON库也有很多。但是我们仍然面临下列问题

1)时不时的爆出这个Json库出现漏洞,那个json库出现漏洞。一旦出现漏洞只能升级,想切换JSON都不成。

2)一个项目中有多个JSON库(这个原因很多,但又不可避免),改Bug可能都得学习多种JSON库

鉴于如上问题,开发了一套easyjson库,你可以把它看做是slf4j一样,它本身不做JSON的处理,可用它来讲任何的JSON进行适配到其他的JSON库上。

它是基于此思路开发出来的。使用它,你的现有项目不需要做一行的代码改变即可在各个JSON库自如的切换。

仓库地址Github EasyJSON

关键特性:

  1. Supports gson, fastjson, jackson, Progsbase ...
  2. Supports tree model, stream model
  3. Control whether serialize null
  4. Convert ON|OFF, 1|0 to Boolean
  5. Serialize or deserialize a Enum based on custom field
  6. Serialize or deserialize a Date using specified pattern | date format
  7. Supports custom exclusion rule, for examples: @Ignore, transient, specified modifier ...
  8. Get the JSONBuilder with zero configuration
  9. Switch the underlying implement without any code change
  10. Supports JDK 1.6+

目前支持将JSON库适配给fastjson, gson, jackason

easyjson facade JSON Implementation
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>easyjson-core</artifactId>
<version>${version}/version>
</dependency>
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>easyjson-gson</artifactId>
<version>${version}/version>
</dependency>
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>easyjson-jackson</artifactId>
<version>${version}/version>
</dependency>
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>easyjson-fastjson</artifactId>
<version>${version}/version>
</dependency>

同时也支持将这些JSON通过easyjson 适配:

JSON Library Maven version Adapter
Android json
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
0.0.20131108.vaadin
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>android-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
fastjson
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
1.2.58
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>fastjson-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
json-lib
<dependency>
<groupId>com.hynnet</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
</dependency>
2.4
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>jsonlib-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
json-smart
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.3</version>
</dependency>
2.3
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>jsonsmart-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
Eclipse minimal-json
<dependency>
<groupId>com.eclipsesource.minimal-json</groupId>
<artifactId>minimal-json</artifactId>
<version>0.9.5</version>
</dependency>
0.9.5
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>minimaljson-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
org.json
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
20180813
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>orgjson-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
Progsbase JSON
<dependency>
<groupId>com.progsbase.libraries</groupId>
<artifactId>JSON</artifactId>
<version>0.3.9</version>
</dependency>
0.3.9
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>progsbase-to-easyjson</artifactId>
<version>${version}</version>
</dependency>
json-simple
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
1.1.1
<dependency>
<groupId>com.github.fangjinuo.easyjson</groupId>
<artifactId>simplejson-to-easyjson</artifactId>
<version>${version}</version>
</dependency>

EasyJson 发布的更多相关文章

  1. MIP 官方发布 v1稳定版本

    近期,MIP官方发布了MIP系列文件的全新v1版本,我们建议大家尽快完成升级. 一. 我是开发者,如何升级版本? 对于MIP页面开发者来说,只需替换线上引用的MIP文件为v1版本,就可以完成升级.所有 ...

  2. Taurus.MVC 2.0 开源发布:WebAPI开发教程

    背景: 有用户反映,Tausus.MVC 能写WebAPI么? 能! 教程呢? 嗯,木有! 好吧,刚好2.0出来,就带上WEBAPI教程了! 开源地址: https://github.com/cyq1 ...

  3. DBImport V3.7版本发布及软件稳定性(自动退出问题)解决过程分享

    DBImport V3.7介绍: 1:先上图,再介绍亮点功能: 主要的升级功能为: 1:增加(Truncate Table)清表再插入功能: 清掉再插,可以保证两个库的数据一致,自己很喜欢这个功能. ...

  4. 发布:.NET开发人员必备的可视化调试工具(你值的拥有)

    1:如何使用 1:点击下载:.NET可视化调试工具 (更新于2016-12-29 19:11:00) (终于彻底兼容了部分VS环境下无法使用的问题) 2:解压RAR后执行:CYQ.VisualierS ...

  5. 微软发布正式版SQL Server 2016

    微软于今天在SQL 官方博客上宣布 SQL Server 数据库软件的正式发布版本(GA),历时一年多,微软为该软件发布了多个公共预览版和候选版本,而今天最终版本终于上线了.在博客中,微软数据集团的企 ...

  6. Castle Core 4.0.0 alpha001发布

    时隔一年多以后Castle 项目又开始活跃,最近刚发布了Castle Core 4.0.0 的alpha版本, https://github.com/castleproject/Core/releas ...

  7. 在离线环境中发布.NET Core至Windows Server 2008

    在离线环境中发布.NET Core至Windows Server 2008 0x00 写在开始 之前一篇博客中写了在离线环境中使用.NET Core,之后一边学习一边写了一些页面作为测试,现在打算发布 ...

  8. ASP.NET Core应用针对静态文件请求的处理[1]: 以Web的形式发布静态文件

    虽然ASP.NET Core是一款"动态"的Web服务端框架,但是在很多情况下都需要处理针对静态文件的请求,最为常见的就是这对JavaScript脚本文件.CSS样式文件和图片文件 ...

  9. nodejs模块发布及命令行程序开发

    前置技能 npm工具为nodejs提供了一个模块和管理程序模块依赖的机制,当我们希望把模块贡献出去给他人使用时,可以把我们的程序发布到npm提供的公共仓库中,为了方便模块的管理,npm规定要使用一个叫 ...

随机推荐

  1. Redis|Sentinel 高可用架构

    一 前言 Redis-Sentinel是Redis官方推荐的高可用性(HA)解决方案,当用Redis做Master-slave的高可用方案时,假如master宕机了,Redis本身(包括它的很多客户端 ...

  2. 浅析runtime包中的三个方法Gosched、Goexit、GOMAXPROCS

    Gosched 暂停当前goroutine,使其他goroutine先行运算.只是暂停,不是挂起,当时间片轮转到该协程时,Gosched()后面的操作将自动恢复 未使用Gosched的代码 packa ...

  3. python 30 基于TCP协议的socket通信

    目录 1. 单对单循环通信 2. 循环连接通信:可连接多个客户端 3. 执行远程命令 4. 粘包现象 4.1 socket缓冲区 4.2 出现粘包的情况: 4.3 解决粘包现象 bytes 1. 单对 ...

  4. 从零开始搭建Java开发环境第一篇:Java工程师必备软件大合集

    1.JDK https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 目前主流的JDK版 ...

  5. Delphi - 获取文件大小

    GetFileSize获取文件大小 封装成如下函数,可以直接使用: ///函数功能:获取文件大小,单位取KB,小数自动进位 ///参数:sFilePath文件全路径 ///Result: 成功是返回文 ...

  6. HDU - 4370 0 or 1 最短路

    HDU - 4370 参考:https://www.cnblogs.com/hollowstory/p/5670128.html 题意: 给定一个矩阵C, 构造一个A矩阵,满足条件: 1.X12+X1 ...

  7. 【牛客多校】Han Xin and His Troops

    题目: His majesty chatted with Han Xin about the capabilities of the generals. Each had their shortcom ...

  8. CountHunter 6101 最优贸易 强联通缩点

    题目传送门 题解:强连通锁点之后. 就成了一副单向图. 然后对于每个点 找到 后面合法的点的最大值就好了. 合法就是后面的那个点可以走到n号点. 也可以正向跑一遍dij 求出到这个点的最小花费. 然后 ...

  9. lightoj 1061 - N Queen Again(状压dp)

    题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1061 题解:显然能满足情况的8皇后的摆法不多,于是便可以用题目给出的状态来匹配 ...

  10. 模板汇总——KMP & EX-KMP

    1. kmp 相当于往前求出一段字符信息,使得 这段字符信息和前缀相等. void getnext(){ , j = ; nx[] = -; while(j < m){ || b[j] == b ...