POJO Generator
Developer tool
- Year
- 2023 — 26
- Built with
- React 18, Monaco Editor, TypeScript, Vite 6 +3 more ↓
- Links
- Live site ↗Source ↗

(01) Overview
A developer tool that turns a JSON document into Java POJO classes — fields, getters and setters and a Guava toString — as you type. Nothing is uploaded; it all runs in the browser.
(02) Features
- 01Side by sideJSON on the left, the generated classes on the right, regenerated as you type.
- 02Real type inferenceEvery array element is read: object arrays merge their fields, [1, 2.5] becomes List<Double>, nested arrays become nested lists.
- 03Safe namesKeys that are not valid Java become valid — first-name to firstName, class to class_ — and clashing class names are numbered.
- 04SettingsRoot class name, package and a header comment, validated and remembered between visits.
- 05ExportCopy a class, download it, or download every class in a .zip.
(03) Screens


(04) On a phone
Same app, smaller screen.
Captured from the live site at 390 pixels wide — the width of most phones in a hand.

(05) Stack
Seven tools, and the job each one does here.
- UIReact18Editor panes, file list and settings
- UIMonaco EditorThe editor behind VS Code, bundled with only JSON and Java
- LanguageTypeScriptThe generator and the interface
- BuildVite6Builds to a static site
- StylingTailwind CSS4Through the Vite plugin
- TestingVitestGenerator tests against a baseline of expected output
- HostingVercelStatic hosting
(06) Under the hood
- 01
The zip is written by hand: a store-only zip writer with its own CRC-32 table, about seventy lines, so there is no compression library in the bundle.
- 02
Monaco is bundled locally with only the JSON and Java languages and their workers, instead of being loaded from a CDN.
- 03
Generation is debounced and memoised on the JSON and the settings, so typing stays smooth on large documents.
- 04
Vitest checks the generator against a baseline file of expected Java output.
Next case
Notes
