Formateurs & Code
JSON en POJO Java
Emit a Java POJO from a JSON sample.
Note de la rédaction
Understanding · Jackson, and a hundred annotations.
Ce chapitre approfondi n'est actuellement disponible qu'en anglais. L'outil de conversion ci-dessus fonctionne dans votre langue ; le long article explicatif n'a pas encore été traduit.
Questions fréquentes
Quick answers.
›What libraries are required for the output?
The generated POJOs are standard Java classes using vanilla syntax. Depending on your configuration, you may want to add `Jackson` or `Gson` annotations for custom key mapping.
›How does it handle nested objects?
The tool recursively parses the JSON and creates separate static inner classes or individual class definitions for each nested object found in the hierarchy.
›Does this tool support Java Records?
Currently, the output defaults to standard class definitions with modifiers. You can manually convert the generated fields into a Record for use in Java 14 or higher.
›Is my data privacy protected?
Yes. The conversion logic is executed entirely via JavaScript within your browser session. No data is stored or sent to a backend during the process.
Les internautes recherchent aussi
Outils similaires
More in this room.
- JSON en interface TypeScriptDéduisez les types à partir d'un exemple JSON et émettez des interfaces TS.
- JSON en classe C#Générez des classes POCO à partir d'un exemple JSON.
- JSON en dataclasse PythonDataclasses typées (avec Pydantic optionnel) à partir de JSON.
- JSON en struct GoStructs Go idiomatiques avec des tags `json:`.
- JSON en classe de données KotlinClasses de données concises pour tout exemple JSON.
- JSON en schéma JSONDéduisez un document de schéma JSON à partir d'un exemple.