JSON to Java POJO & Class Converter
BeanTrans converts nested JSON and JSON5 payloads into strongly typed Java POJOs directly in browser memory with zero server uploads. It splits nested objects into companion class tabs and supports Lombok @Data, Jackson @JsonProperty, JPA / Hibernate, and MyBatis-Plus presets.
Key Capabilities
- Automatic camelCase field mapping paired with optional Jackson @JsonProperty annotations for snake_case JSON keys.
- One-click toggle for Lombok @Data, private/public access modifiers, and JPA or MyBatis-Plus entity annotations.
- Nested JSON objects and object arrays are cleanly extracted into dedicated companion Java class tabs.
Type Mapping Reference
| Source | Target | Notes |
|---|---|---|
string | String | Standard java.lang.String |
integer | int / Long / BigDecimal | Configurable in General settings |
decimal | double / BigDecimal | Float/Double precision preserved |
array<T> | List<T> | Typed java.util.List |
nested object | Companion Class | Extracted to separate tab |
Frequently Asked Questions
Does BeanTrans support Lombok and Jackson annotations when converting JSON to Java?
Yes. Open the Config drawer at the bottom of the workbench to toggle Lombok @Data, Jackson @JsonProperty, access modifiers, and JPA or MyBatis-Plus ORM annotations.
Is my JSON payload uploaded to a server during Java code generation?
No. BeanTrans runs 100% locally in your browser via a TypeScript AST engine, making it safe for internal API responses and proprietary schemas.
Can I convert the generated Java class back to JSON or to another language?
Yes. Click the swap button between the two panels to flip Java to JSON, or choose Go, Rust, TypeScript, Kotlin, Python, Protobuf, or SQL DDL from the target selector.