I should mention that, if it is not a bean, we generally provide a constructor that takes a JSON type such as Map that you can use to instantiate the object. All of Pivot's "struct" classes, including Dimensions, Point, etc., work this way so you can use them as a reference.
On Jul 2, 2010, at 9:35 AM, Greg Brown wrote: >> What recommendation do people have for converting json syntax to an object? >> Should I grab a library? If so, any suggestions on which one? > > If it is a bean, you can use JSONSerializer. See > org.apache.pivot.tests.JSONBeanTest for an example. > >> Ideally, I could register my converter and it gets called automatically when >> I indicate the need for a conversion to a certain type. > > Generally, we handle this by providing a string setter that performs the > conversion and calls the typed setter. > >
