In what way can Java generate a Bean (not just a Map object)--a bean with fields, getters, and setters from a JSON String.
Here's the code I am trying now using ByteBuddy (non-working code/error):
Object contextObject = new ByteBuddy()
.subclass(Object.class)
.defineField("date", String.class, Modifier.PUBLIC)
.defineMethod("getDate", Void.TYPE, Modifier.PUBLIC)
.intercept(FieldAccessor.ofField("date"))
.make()
.load(getClass().getClassLoader(), ClassLoadingStrategy.Default.WRAPPER)
.getLoaded()
.newInstance();
BeanUtils.setProperty(contextObject, "date", "August 1, 2017");
However, due to the "wired" natured for ByteBuddy, I am not sure how flexible it can be to generate a dynamic bean from JSON.