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. 对微软的敌视何时休? 从一篇语言评论文章对C#的评价说起

    看到一篇公众号文章<2020年什么编程语言最受欢迎,待遇最高?>,其中对C#的描述如下: 点击阅读原文,看到这是一篇翻译文章:https://codinginfinite.com/top- ...

  2. Hadoop HA Hbase启动报UnknownHostException: mycluster

    Hadoop HA 搭建hbase启动时只有HMaster起来,HRegionServer没有起来 查看报错信息为: 2019-08-31 19:17:14,212 ERROR [main] regi ...

  3. MSIL实用指南-Action的生成和调用

    MSIL实用指南-Action的生成和调用 System.Action用于封装一个没有参数没有返回值的方法.这里生成需要Ldftn指令. 下面讲解怎生成如下的程序. class ActionTest ...

  4. js的真值与假值

    假值 结果为 false 的值称为 假值.例如,空字符串 "" 为假值,因为在布尔表达式中,"" 等于 false. false == 0返回:true fal ...

  5. 基于Taro与typescript开发的网易云音乐小程序(持续更新)

    基于Taro与网易云音乐api开发,技术栈主要是:typescript+taro+taro-ui+redux,目前主要是着重小程序端的展示,主要也是借此项目强化下上述几个技术栈的使用,通过这个项目也可 ...

  6. [code] python+selenium实现打开一个网页

    转载自: http://www.cnblogs.com/fnng/archive/2013/05/29/3106515.html http://www.testwo.com/blog/6931 在ec ...

  7. Codeforces 468 B Two Sets

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

  8. hdu2082 找单词 母函数模板

    找单词 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  9. 【LeetCode】DFS 总结

    DFS(深度优先搜索) 常用来解决可达性的问题. 两个要点: 栈:用栈来保存当前节点信息,当遍历新节点返回时能够继续遍历当前节点.可以使用递归栈. 标记:和 BFS 一样同样需要对已经遍历过的节点进行 ...

  10. 阿里社招Java面试题总结——面试官分享

    面试题 1.Java中的内存溢出是如何造成的 2.gc的概念,如果A和B对象循环引用,是否可以被GC? 3.Error.Exception和RuntimeException的区别,作用又是什么? 4. ...