2 ms·
You can inline native type-safe JSON directly in Java with the manifold project. /*[Dude.json/] { "Name": "Scott", "Age": 100, "Address":
by owlstuffing 2mo ago
You can inline native type-safe JSON directly in Java with the manifold project.
/*[Dude.json/] {
"Name": "Scott",
"Age": 100,
"Address": {
"Street": "345 Syracuse Way",
"City": "Atlantis"
}
}
*/
Dude dude = Dude.fromSource();
out.println(dude.getName());
out.println(dude.getAge());
out.println(dude.getAddress().getCity());
https://github.com/manifold-systems/manifold https://github.com/manifold-systems/manifold
- fallingbananna 2mo agoYou could... but I view JSON as a simple format that you could write a recursive parser for in a few hundred lines yourself. Bringing in compile-time code generation just for defining static JSONs (which is not that common outside of tests, as most JSONs are serialized and deserialized at runtime) sounds like a hard sell.
- owlstuffing 2mo agoThis is just a small part of manifold’s JSON integration. And, yes, the inline aspect is mostly for testing, and it’s awesome there.