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


JSON to C# Class

Generate Newtonsoft annotated C# model or stub classes from JSON text, document, file or data

View Tool
Background Information

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. JSON format was first specified by Douglas Crockford in the early 2000s

Settings Explained

  • 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;
        }
    }

 

You may also like...

Class From CSV Generator

Generate C# model or stub classes from CSV text, file or data

View Tool

GUID Generator

Generate random GUID / UUID based on RFC 4122 Version 4

View Tool

Comments 0



History

Sep 18, 2018
Tool Launched