When I switch to 2.8.0-SNAPSHOT, then serializing the bean to json works. However, deserializing it from json fails. Updated code:
-- Factory factory = GWT.create(Factory.class);
Test test = factory.test().as();
GWT.log("Created bean");
Map<String, String> testMap = new HashMap<>();
testMap.put("foo", "bar");
test.setTest(testMap);
GWT.log("Set map");
String json = AutoBeanCodex.encode( AutoBeanUtils.getAutoBean(test) ).getPayload();
GWT.log("Got json: " + json);
Test decoded = AutoBeanCodex.decode(factory, Test.class, json).as();
GWT.log("Decoded");Output:
Created bean
Set map
Got json: {"test":{"foo":"bar"}}
Uncaught ReferenceError: Ljava_util_Collection_2_classLit_0_g$ is not defined FactoryImpl.java:9 initializeCreatorMap_0_g$ AbstractAutoBeanFactory.java:84
maybeInitializeCreatorMap_0_g$ AbstractAutoBeanFactory.java:37
create_59_g$ AutoBeanCodexImpl.java:544
doDecode_0_g $AutoBeanCodex.java:39 decode_2_g$AutoBeanCodex.java:55 decode_3_g$BeanTest.java:34 onModuleLoad_3_g$com_00046test_00046BeanTest__EntryMethodHolder.java:3 init_2_g$ModuleUtils.java:44 initializeModules_0_g$Impl.java:247 apply_0_g$Impl.java:306 entry0_0_g$Impl.java:72 (anonymous function)ModuleUtils.java:55 gwtOnLoad_0_g$Splittable.java:26 (anonymous function)
Trying to use a List also gives a similar reference error, this time about Iterator not being defined. This is making it unfeasible to use autobeans..
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment