Re: How to define AutoBeanFactory?

2012-10-22 Thread Thomas Broyer
On Saturday, October 20, 2012 8:33:04 PM UTC+2, dhoffer wrote: Yeah that helps a ton. That's by far the best explanation of how to use AutoBeans that I have seen, I recommend that this get added to the current docs on the web. That being said I'm still getting an error in one place.

Re: How to define AutoBeanFactory?

2012-10-20 Thread David Hoffer
Yeah that helps a ton. That's by far the best explanation of how to use AutoBeans that I have seen, I recommend that this get added to the current docs on the web. That being said I'm still getting an error in one place. In this call in my code AutoBeanCodex.encode(payloadAutoBean)...several

Re: How to define AutoBeanFactory?

2012-10-19 Thread Andrea Boscolo
Have you read http://code.google.com/p/google-web-toolkit/wiki/AutoBean ? I think this can help to get you started. On Thursday, October 18, 2012 10:46:32 PM UTC+2, dhoffer wrote: I'm trying to figure out how to use AutoBeanFactory to decode a JSONString, e.g. AutoBeanIPayload autoBean =

Re: How to define AutoBeanFactory?

2012-10-19 Thread David Hoffer
I did find that but it doesn't explain much at all. Regarding the AutoBeanFactory it just says: interface MyFactory extends AutoBeanFactory { // Factory method for a simple AutoBean AutoBeanPerson person(); // Factory method for a non-simple type or to wrap an existing instance

Re: How to define AutoBeanFactory?

2012-10-19 Thread Thomas Broyer
On Friday, October 19, 2012 3:42:35 PM UTC+2, dhoffer wrote: I did find that but it doesn't explain much at all. Regarding the AutoBeanFactory it just says: interface MyFactory extends AutoBeanFactory { // Factory method for a simple AutoBean AutoBeanPerson person(); //

Re: How to define AutoBeanFactory?

2012-10-19 Thread dhoffer
Thanks that really helps. Is just defining the top level interface enough, e.g. interface MyAutoBeanFactory extends AutoBeanFactory { AutoBeanIPayload payload(); } Or would I need to include factory methods for all nested interfaces contained/referenced by IPayload? E.g. interface

Re: How to define AutoBeanFactory?

2012-10-19 Thread Thomas Broyer
On Friday, October 19, 2012 4:20:58 PM UTC+2, dhoffer wrote: Thanks that really helps. Is just defining the top level interface enough, e.g. interface MyAutoBeanFactory extends AutoBeanFactory { AutoBeanIPayload payload(); } Or would I need to include factory methods for all

Re: How to define AutoBeanFactory?

2012-10-19 Thread dhoffer
With the factory created I'm not getting any json data decoded. The decoded type is something like ipt.tas.app.ui.gwt.client.IPayloadAutoBean$2@2dbb24d0 instead of the expected IPayload. I'm not sure what this is ...but all of the data that IPayload's methods should have contained is null.

Re: How to define AutoBeanFactory?

2012-10-19 Thread Jens
AutoBeanUtils.getAutoBean(payload); will only return an AutoBeanIPayload instance if the method parameter already belongs to an AutoBean (see JavaDoc). So things would look like the following (from memory, hopefully its correct): //GWT client side MyAutoBeanFactory factory =

How to define AutoBeanFactory?

2012-10-18 Thread dhoffer
I'm trying to figure out how to use AutoBeanFactory to decode a JSONString, e.g. AutoBeanIPayload autoBean = AutoBeanCodex.decode(myAutoBeanFactory, IPayload.class, jsonValue.stringValue()); IPayload payload = autoBean.as(); What I'm not clear on is how to define myAutoBeanFactory? I