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 p ); // wrap existing
}
3) Create wrapped AutoBean and serialise with AutoBeanCodex.encode to JSON
PersonPojo myPersonPojo = new PersonPojo("joe");
AutoBean autoBeanPerson = personFactory.person( myPersonPojo );