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
AutoBean<Person> person();
// Factory method for a non-simple type or to wrap an existing instance
AutoBean<Person> person(Person toWrap);
}
There is no explanation of what person() is even in this overly simplified case.
Am I to assume that person() refers to getPerson() and
setPerson(Person) java bean methods on another object? If so, does
AutoBeanFactory require strict java beans naming conventions? In my
case I don't have Java beans, I just have a serailizable POJO with an
interface. E.g. getMessages() returns an IGWTMessage. How can I
configure AutoBeanFactory to handle this?
-Dave
On Fri, Oct 19, 2012 at 2:40 AM, Andrea Boscolo <[email protected]> wrote:
> 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.
>>
>> 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/-/pc_zKSdHe9YJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.