FastJSON is an open source Java serialization and deserialization third-party library, which can easily convert Java objects and JSON strings to each other for data transmission. There are also Jackson and Gson, which are suitable for scenarios with large data volumes. Gson is a Google product that is easy to use and not as fast as FastJSON.
JSON object
- A JSONObject and JSONArray
- It is between Java objects and JSON strings, and can be converted to Java objects and JSON strings
- There is the getXxx() method, which takes a key, the key corresponding value is a Xxx, and returns the Xxx
- Inherited from the JSON
serialization
- To convert a Java object to a JSON string, the interface is json.tojsonString (). The input parameter can be a Java object, a collection of Java objects, or a JSON object and its collection
- You can add serialization tags to customize whether or not to serialize, field order, date format, and so on.
deserialization
- To convert a JSON string to a Java object, the interface is json.parseObject (). The first input parameter is the JSON string to be converted, and the second is the Class of the Java class. If the second argument is left blank, JSONObject is returned by default.