What this does
Generates plain Java classes (POJOs) with private fields and getters and setters from a JSON sample. Every nested object becomes its own class, and the output lists each class under a// ClassName.java marker so you can split it into files.
Example
Input
{
"id": 42,
"name": "Ada",
"verified": true,
"tags": [
"admin",
"dev"
],
"orders": [
{
"sku": "A1",
"qty": 2
},
{
"sku": "B2",
"qty": 1,
"note": "gift"
}
]
}Output with default options
// Root.java
package com.example;
import java.util.List;
public class Root {
private long id;
private String name;
private boolean verified;
private List<String> tags;
private List<Order> orders;
public long getID() { return id; }
public void setID(long value) { this.id = value; }
public String getName() { return name; }
public void setName(String value) { this.name = value; }
public boolean getVerified() { return verified; }
public void setVerified(boolean value) { this.verified = value; }
public List<String> getTags() { return tags; }
public void setTags(List<String> value) { this.tags = value; }
public List<Order> getOrders() { return orders; }
public void setOrders(List<Order> value) { this.orders = value; }
}
// Order.java
package com.example;
public class Order {
private String sku;
private long qty;
private String note;
public String getSku() { return sku; }
public void setSku(String value) { this.sku = value; }
public long getQty() { return qty; }
public void setQty(long value) { this.qty = value; }
public String getNote() { return note; }
public void setNote(String value) { this.note = value; }
}
How values are mapped
- Whole numbers become
long, other numbersdouble, stringsString, booleansboolean. - Arrays become
List<T>(orT[]if you choose arrays). - ISO 8601 timestamps become
OffsetDateTime, orDatewith the legacy option; UUID strings becomeUUID. - Values that are always
nullbecomeObject; mixed-type arrays get a small holder class with one field per type.
Options
Set the package and root class name, pick lists or arrays, and choosejava.time or java.util.Date. Lombok annotationsreplaces the getters and setters with a @lombok.Data annotation. WithTypes only turned off, the classes get Jackson @JsonPropertyannotations and a Converter class with fromJsonString andtoJsonString methods.
Things to know
Property names are converted to Java conventions (x-y becomes xY); with Jackson annotations on, the original key is preserved. Include several representative objects in an array so the generated types reflect every field your data can contain.
Privacy
Generation runs in a Web Worker in your browser. The JSON is never uploaded.