Hi Guys,
I have some problem when decoding some JSON data using the
AutoBeanCodex.
I have an AutoBean that contains getters and setters for some
privitive types and also for some Map too.
When i deserialize a json with the AutoBeanCodex, i can deserialize
the primitive types without any problem, but when i try to deserialize
a Map i get NullPointerException, however I can see in the json string
that the variable contains data.
Here is some source code:
public class Deserializer {
private String msg = "{\"myInt\":2010,\"myMap\":{\"8.0\":true}";
private Options options;
public Deserializer() {
FilterOptionsBeanFactory myFactory =
AutoBeanFactorySource.create(OptionsBeanFactory.class);
options = AutoBeanCodex.decode(myFactory, Options.class,msg ).g
// This works fine
System.out.println(options.getMyInt());
// This generates NPE
System.out.println(options.getMyMap());
}
}
public interface Options {
Map<Double, Boolean> public int getMyInt();
void setMyInt(int myInt);
Map<Double, Boolean> getMyMap();
void setMyMap(Map<Double, Boolean> myMap);
}
--
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.