Thanks that really helps.  Is just defining the top level interface enough, 
e.g.

interface MyAutoBeanFactory extends AutoBeanFactory {
    AutoBean<IPayload> payload();
}

Or would I need to include factory methods for all nested interfaces 
contained/referenced by IPayload?  E.g.

interface MyAutoBeanFactory extends AutoBeanFactory {
    AutoBean<IPayload> payload();
    AutoBean<IGWTMessage> message();
    AutoBean<IGWTInitializationMessage> initializationMessage();
    AutoBean<IGWTViewInstruction> viewInstruction();
    AutoBean<IGWTViewReference> viewReference();
    AutoBean<IGWTViewInstructionParameter> viewInstructionParameter();
    AutoBean<IGWTViewInstructionResult> viewInstructionResult();
}

Regarding AutoBeans not supporting arrays, if I can get it to support my 
data structure types, I can convert the logic to use a List instead of the 
array.

Thanks,
-Dave


On Thursday, October 18, 2012 2:46:32 PM UTC-6, dhoffer wrote:
>
> I'm trying to figure out how to use AutoBeanFactory to decode 
> a JSONString, e.g.
>
> AutoBean<IPayload> autoBean = AutoBeanCodex.decode(myAutoBeanFactory, 
> IPayload.class, jsonValue.stringValue());
> IPayload payload = autoBean.as();
>
> What I'm not clear on is how to define myAutoBeanFactory?
>
> I understand that's an interface passed 
> to GWT.create(MyAutoBeanFactory.class), but what methods 
> does MyAutoBeanFactory need?
>
> My IPayload and its content is defined as:
>
> public interface IPayload extends Serializable {
>     IGWTMessage[] getMessages();
>     void setMessages(IGWTMessage[] messages);
> }
>
> public interface IGWTMessage extends IGWTMessage {
>     IUUIDReference getMessageId();
>     void setMessageId(IUUIDReference id);
> }
>
> Then there are about a dozen derived interfaces that 
> extend IGWTMessage and then each of those has its concrete implementation 
> class.
>
> How can I handle this with AutoBeanFactory/JSON?
>
> Btw, this used to be just Serialized and marshaled that way but now I'm 
> trying to use a different approach that requires JSON.  Also, if there was 
> a way to just do a regular Java binary serialization that would be fine too 
> as I could then turn that into a Base64 encoded string and send just that 
> via JSON...then do the reverse on the server.  (But I haven't yet seen a 
> way to do Java binary serialization in the GWT client.) 
>
> Thanks,
> -Dave
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/8_NSood-2GAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to