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. Console也要美颜了,来给Console添色彩

    我们在开发过程中,经常需要将不同的信息用颜色标记出来,这可以让我们快速关注到重点信息.想必大家都知道,可以通过Console. ForegroundColor设置输出文字的颜色,背景颜色可以通过Con ...

  2. Gradle-日志

    日志就像是构建工具的 UI,如果输出太混乱,真正的警告和错误很容易就被忽略了.Gradle 定义了 6 种日志级别,以便于我们识别有用的信息. 日志级别 Gradle 的日志 和Android 一样也 ...

  3. mac下面有epoll?

    没有的,但是mac下面有kqueue,跟epoll原理是差不多的. 这个是没办法的,如果实在需要,就用Ubuntu吧,这个也可以无缝迁移. 更多资源,更多文章由小白技术社提供(是我啦)

  4. 实验Oracle数据文件被误删除的场景恢复

    环境:RHEL 5.4 + Oracle 11.2.0.3 背景:数据库没有备份,数据库文件被误操作rm,此时数据库尚未关闭,也就是对应句柄存在,如何快速恢复? 1.某个普通数据文件被删除 2.所有数 ...

  5. Comupter Tools 清单------包含但不限于此

  6. 牛客-长沙理工校赛C-取手机

    传送门:https://www.nowcoder.com/acm/contest/96/C 参考:http://www.cnblogs.com/Dillonh/p/8835074.html 题意: d ...

  7. Codeforces 468 B Two Sets

    Two Sets 题意:就是将一对数放进setA, setB中, 如果放进setA的话要求满足 x与a-x都在这个集合里面, 如果放进setB中要求满足x与b-x都在这个集合中. 题解:我们将能放进B ...

  8. codeforces E. Mahmoud and Ehab and the function(二分+思维)

    题目链接:http://codeforces.com/contest/862/problem/E 题解:水题显然利用前缀和考虑一下然后就是二分b的和与-ans_a最近的数(ans_a表示a的前缀和(奇 ...

  9. 在Linux查看版本命令

    1.在终端中执行下列指令: cat /etc/issue 可以查看当前正在运行的 Ubuntu 的版本号. 2. 使用 lsb_release 命令也可以查看 Ubuntu 的版本号,与方法一相比,内 ...

  10. DAX 第八篇:表连接

    表连接是指两张表根据关联字段,组合成一个数据集.表连接不仅可以利用数据模型中已有的关系,而且可以利用DAX表达式基于表的任意列定义连接条件.因此,在DAX中,实现表与表之间的连接,有两种方式: 第一种 ...