Fastjson is a high-performance and complete JSON library written in Java language. It uses an "assumed ordered fast matching" algorithm to improve the performance of JSON Parse to the extreme. It is currently the fastest JSON library in the Java language. The Fastjson interface is simple and easy to use, and has been widely used in various application scenarios such as cache serialization, protocol interaction, Web output, and Android clients.
fastjson is Alibaba's open source JSON parsing library. It can parse JSON format strings, supports serialization of Java Beans into JSON strings, and can also deserialize from JSON strings to JavaBeans. It has been widely used in various scenarios, including cache storage, RPC communication, MQ communication, network protocol communication, Android client, Ajax server handler, etc.
Tips: Before continuing to learn Fastjson, you need to know something about Java and JSON.
fastjson main features:
Fast FAST (faster than any other Java-based parser and generator, including jackson)
Powerful (supports ordinary JDK classes including any Java Bean Class, Collection, Map, Date or enum)
Zero dependencies (no dependencies on any other class libraries except JDK )
Sample code:
import com.alibaba.fastjson.JSON; Group group = new Group(); group.setId(0L); group.setName("admin"); User guestUser = new User(); guestUser.setId(2L); guestUser.setName("guest"); User rootUser = new User(); rootUser.setId(3L); rootUser.setName("root"); group.getUsers().add(guestUser); group.getUsers().add(rootUser); String jsonString = JSON.toJSONString(group); System.out.println(jsonString);
Tips: Our fastjson tutorial will help you learn how to use fastjson step by step, if you have If you have any questions, please go to the PHP Chinese website fastjson community to ask your questions, and enthusiastic netizens will answer them for you.
Download
android developers please seehere
or through Maven:
<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>VERSION_CODE</version> </dependency>
or through Gradle:
compile 'com.alibaba:fastjson:VERSION_CODE'
use the real release version number of here or here or here, Replace VERSION_CODE, for example 1.2.21
Content covered by this fastjson tutorial manual
This fastjson tutorial manual covers all basic and advanced knowledge of fastjson, including Fastjson Android version, Fastjson custom serialization, and Fastjson processing Detailed introduction to oversized JSON text, Fastjson circular references, and Fastjson common problems and examples.
Tips: Each chapter of this tutorial contains many code examples that will help you better understand and use fastjson.
Latest chapter
- Fastjson 使用实例 2017-02-20
- Fastjson Obejct/Map/JSON/String 互转 2017-02-20
- Fastjson 对象或数组转JSON 2017-02-20
- fastjson Benchmark 2017-02-20
- Fastjson BeanToArray 2017-02-20
- Fastjson API SerializeFilter 2017-02-20
- Fastjson API ParseProcess 2017-02-20
- Fastjson DataBind 2017-02-20
Related courses
- The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course) 2022-02-17
- Let's briefly talk about starting a business in PHP 2023-01-04
- Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things 2018-01-25
- Login verification and classic message board 2018-03-02
- Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum] 2022-06-28
- Quick Start Node.JS Full Version 2022-09-30
- Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance) 2022-12-08
- Horse soldier spring video tutorial 2022-04-12