How to use the json to java
- Paste your source into the input panel, or select Load sample.
- Set a root model name for the generated code.
- Select Run tool, review the result, then copy or download it.
Working with Java models
Add Jackson annotations to your project and deserialize with your configured ObjectMapper. The output uses public fields and package-private classes. Split the classes into files if you make them public.
Example input
{
"user_id": 42,
"name": "Alex",
"active": true,
"address": {
"city": "Dubai"
},
"roles": [
"developer",
"reviewer"
]
}Frequently asked questions
Does the Java output need a dependency?
Yes. JsonProperty is a Jackson annotation and requires jackson-annotations. Classes use public fields, boxed numeric types, and List<T>; put them in your intended package and configure your JSON mapper.
Can it infer nested Java classes?
Yes. Objects become additional model classes and arrays become typed lists. The generated classes are package-private so they can share a file; make classes public and split files as your project requires.
A note about your data
Input and output remain in this browser tab. CompileTime does not upload them for processing or save them in local storage. Avoid pasting production credentials into any online tool. Optional analytics track tool names and actions, never the entered values.