JSON Tool class Library: Alibaba/fastjson usage record

Source: Internet
Author: User

JSON Tool Class Library: Alibaba/fastjson using record one, understanding JSON

JSON standard specification Chinese document: http://www.json.org/json-zh.html

Best Practice: http://kimmking.github.io/2017/06/06/json-best-practice/(advanced use of JSON, especially valuable for reference)

Ii. Project address and wiki:

Git address: Https://github.com/alibaba/fastjson

Wiki:https://github.com/alibaba/fastjson/wiki

faq:https://github.com/alibaba/fastjson/wiki/Frequently Asked Questions

Iii. main functions and advantages

There are three main classes of common use:

1. JSON: The methods of serialization and deserialization (parse () and tojsonstring ()) are in this class

 Public Static FinalObject Parse (String text);//parse the JSON text to Jsonobject or Jsonarray Public Static FinalJsonobject parseobject (String text);//parse the JSON text into Jsonobject Public Static Final<T> T parseobject (String text, class<t> clazz);//parse the JSON text to JavaBean Public Static FinalJsonarray Parsearray (String text);//parse the JSON text into Jsonarray Public Static Final<T> list<t> Parsearray (String text, class<t> clazz);//parse the JSON text into a JavaBean collection Public Static FinalString tojsonstring (Object object);//serializing JavaBean to JSON text Public Static FinalString tojsonstring (Object object,BooleanPrettyformat);//serialize JavaBean to formatted JSON text Public Static FinalObject ToJSON (object javaobject); Convert JavaBean to Jsonobject or Jsonarray.

2. Jsonobject: This class is required when deserializing to an object, while providing an action method for the object

3. Jsonarray: This class is required when deserializing to an array of objects, while providing an action method for the object

the difference between Jsonobject and Jsonarray: understandable jsonobject is used for an object, Jsonarray for multiple objects.

Iv. References:
    1. Fastjson:http://www.cnblogs.com/zhenmingliu/archive/2011/12/29/2305775.html (Reference)
    2. Best Practice: http://kimmking.github.io/2017/06/06/json-best-practice/(high-level use of JSON, reference value)
    3. Fastjson Document Interpretation--Previous: http://blog.csdn.net/cqhzq2014/article/details/49512939 (mainly on the class and method of analysis, can refer to, the value is small, can see the source understanding)
    4. Fastjson document Interpretation--Next: http://blog.csdn.net/cqhzq2014/article/details/50117155 (mainly on the class and method of analysis, can refer to, the value is small, can see the source understanding)

JSON Tool class Library: Alibaba/fastjson usage record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.