To clarify, you need to add something like makeAddress to DoSomething:
Address makeAddress() {
// Construct the AutoBean
AutoBean<Address> address = factory.address();
// Return the Address interface shim
return address.as();
}
Then you can change your code to:
DoSomething test = new DoSomething();
Person person = test.makePerson();
person.setName("me");
person.setAddress(test.makeAddress());
String json = test.serializeToJson(person);
On Fri, Jun 17, 2016 at 4:13 PM, Michael McIntosh <[email protected]
> wrote:
> You need to create the person by calling makePerson.
>
> Sent from my iPhone
>
> On Jun 17, 2016, at 3:35 PM, sdfdsf dsfsdfds <[email protected]>
> wrote:
>
> Hi,
>
> I copy / pasted the AutoBean serialization example from here:
>
> http://www.gwtproject.org/doc/latest/DevGuideAutoBeans.html
>
> I've implemented the necessary interfaces etc to setup a quick test which
> can be summarized as follows:
>
> PersonImpl person = new PersonImpl();
> person.setName("me");
> person.setAddress(new AddressImpl(...));
>
> DoSomething test = new DoSomething();
> String json = test.serializeToJson(person);
>
> The value of "json" is null.
>
> Is this sample working for everyone? I'm using GWT 2.7 with java 1.7.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>
>
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.