Java Class From JSON Generator

Updated: Sep 18, 2018

Generate annotated POJO or stub classes from JSON document.

Input: Paste JSON content below



Settings

Output: Generated Classes


Generate Java Class from JSON

Use this tool to quickly generate model classes for Java or POJOs from a sample JSON document. The Java model classes are annotated using JsonProperty attribute supplied by Jackson.

JSON

JavaScript Object Notation (JSON) pronounced as "Jason" is the de facto standard for data interchange on the web these days. It is a simple format that is easier to comprehend than XML. It also has less size than XML because of no closing tags. Interacting with JSON from JavaScript is extremely seamless.

Annotate
If selected, properties are annotated using Newtonsoft.Json's JsonProperty attribute.
Annotate On
public class Person {
    private String name;
    private int age;

    @JsonProperty("name")
    public String getName() {
        return name;
    }

    @JsonProperty("name")
    public void setName(String name) {
        this.name = name;
    }

    @JsonProperty("age")
    public int getAge() {
        return age;
    }

    @JsonProperty("age")
    public void setAge(int age) {
        this.age = age;
    }
}
Annotate Off
public class Person {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
 
Created: Sep 18, 2018
Online Tool Designed For: Windows, OS X, Android, iOS, Linux