Java JSON processing class library Jackson

Source: Internet
Author: User

Jackson is a set of data processing library tools for the Java platform, and Jackson's main function is to provide JSON parsing and generation, and Jackson also provides additional class libraries to support the processing of Avro, CBOR, CSV, Smile, XML, and YAML, It's very powerful and it's great to work with JSON data in Java.

The relevant sample code:

{  "name" :{"First": "Joe", "Last":  "Sixpack" } ,  "Gender" :"MALE",  "verified" :false,  "Userimage" : "rm9vymfyiq=="}
 Public  class User {   Public enumGender {MALE, FEMALE};   Public Static  class Name {    PrivateString _first, _last;     PublicString GetFirst () {return_first; }     PublicString GetLast () {return_last; }     Public voidSetfirst (String s) {_first = s;}     Public voidSetlast (String s) {_last = s;}  }  PrivateGender _gender;  PrivateName _name;  Private Boolean_isverified;  Private byte[] _userimage;   PublicName GetName () {return_name; }   Public BooleanIsverified () {return_isverified; }   PublicGender Getgender () {return_gender; }   Public byte[] Getuserimage () {return_userimage; }   Public voidSetName (Name n) {_name = n;}   Public voidSetverified (Booleanb) {_isverified = b;}   Public voidSetgender (Gender g) {_gender = g;}   Public voidSetuserimage (byte[] b) {_userimage = b;}}
New //Can reuse, share globally User user = Mapper.readvalue (new File ("User.json"), user.  Class);

As a JSON-processing class library tool, Jackson is also very convenient to use.

Java JSON processing class library Jackson

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.