EasyJson release

JSON library is very popular, and now open source JSON libraries, there are many. But we still face the following issues

Burst 1) Json library from time to time this loophole, a loophole in the json library. Once vulnerabilities can only upgrade, I do not want to switch to JSON.

2) a project has multiple JSON library (a lot of reasons for this, but inevitable), change the Bug may have to learn a variety of JSON library

 

In view of the above problems, developed a easyjson library, you can see it as slf4j the same, do not do it itself JSON processing, it can be used in terms of any of JSON adapt to other JSON library.

It is based on this idea developed. Use it to your existing projects do not need to change one line of code can be freely switched in various JSON libraries.

 

Warehouse Address : Github EasyJSON

Key Features:

  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+

 

The library currently supports JSON adapt to 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>
                

 

Also supports these JSON by easyjson adaptation:

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>
                

Guess you like

Origin www.cnblogs.com/f1194361820/p/11572138.html