Automatically generate model class (Java) based on JSON string

Source: Internet
Author: User

Automatically generate model classes based on JSON

Java

Convert JSON to Java class http://jsongen.byingtondesign.com you bring the JSON, we'll bring the code

Find a great site that can directly generate a JSON string into the Java model class, super convenient. Long ago knew, has not been used, yesterday in the g+ data, used. Combined with Gson, you basically don't have to do anything, and you'll soon be able to convert to Java objects.

Usage: Find a full JSON big data, save it as a. json file, upload it to a Web disk, generate a download link, and then throw the download link into the website. (You may need to add. JSON at the back of the download link that you generated from the network disk):) haha ~

Like what

{  "status": 1,  "sort": 1,  "id": 8,  "ItemName": "System Bulletin",  "Itemdesc": "",  "ItemCode": "Sysnotic E ",  " Columncode ":" Info "}

Automatically generate Java classes

Package Com.json.test;import org.json.*;p ublic class Model {private double status;    private double sort;    private double ID;    Private String ItemName;    Private String Itemdesc;    Private String ItemCode;        Private String Columncode;    Public Model () {} public double GetStatus () {return this.status;    } public void SetStatus (double status) {this.status = status;    } public double Getsort () {return this.sort;    } public void Setsort (double sort) {this.sort = sort;    } public double GetId () {return this.id;    } public void SetId (double id) {this.id = ID;    } public String Getitemname () {return this.itemname;    } public void Setitemname (String itemname) {this.itemname = ItemName;    } public String Getitemdesc () {return this.itemdesc;    } public void Setitemdesc (String itemdesc) {this.itemdesc = Itemdesc; } public String Getitemcode () {        return this.itemcode;    } public void Setitemcode (String itemcode) {this.itemcode = ItemCode;    } public String Getcolumncode () {return this.columncode;    } public void Setcolumncode (String columncode) {this.columncode = Columncode; }    }

In addition, the format of the JSON data of the site more than: http://jsoneditoronline.org note (Ta will automatically save your parsed JSON data)

The Mac has a tool called JSON Accelerator, which supports some languages other than Java.

Automatically generate model class (Java) based on JSON string

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.