fastJSON learning - basic introduction

1. What is fastjson?

fastjson is Alibaba's open source JSON parsing library. It can parse strings in JSON format, and supports serialization of Java Beans to JSON strings, as well as deserialization from JSON strings to JavaBeans.

2. Advantages of fastjson

2.1 Fast speed
Compared with other JSON libraries, fastjson is characterized by fast speed. Since the release of version 1.1.x of fastjson in 2011, its performance has never been surpassed by other JSON libraries implemented in Java.

2.2 Widely used
fastjson is widely used in Alibaba, deployed on tens of thousands of servers, and fastjson is widely accepted in the industry. In 2012, it was selected as one of the most popular domestic open source software by Open Source China.

2.3 Test complete
fastjson has a lot of testcases. In version 1.2.11, there are more than 3321 testcases. Regression testing is performed on each release to ensure consistent quality.

2.4
The API using simple fastjson is very concise.

String text = JSON.toJSONString(obj); //序列化
VO vo = JSON.parseObject("{...}", VO.class); //反序列化

2.5 Complete functions
Support generics, stream processing large text, support enumeration, support serialization and deserialization extensions.

3. Download and use

You can download it directly from the maven central repository:

http://repo1.maven.org/maven2/com/alibaba/fastjson/
or configure maven dependencies


com.alibaba
fastjson
xxx

where xxx is the version number, follow-up needs to use a specific version, it is recommended to use the latest version.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325559004&siteId=291194637