I\'m hoping someone can suggest a simple solution to my problem.
I have a POJO, say:
public class Person
{
private String name;
public String
It is possible if its a simple POJO and does not have properties of other autobean types:
1) Make PersonPojo implements Person
2) Add a wrapper method to the factory:
public interface PersonFactory extends AutoBeanFactory {
AutoBean<Person> person( Person p ); // wrap existing
}
3) Create wrapped AutoBean and serialise with AutoBeanCodex.encode
to JSON
PersonPojo myPersonPojo = new PersonPojo("joe");
AutoBean<Person> autoBeanPerson = personFactory.person( myPersonPojo );
You simply can't. AutoBean generates lightweight, optimized implementations of the interfaces; it obviously cannot do this for classes. This is by design.