I'm having trouble converting a an object from JSON into a JavaScript Overlay object, and back again. I have the following in the class now:
public class Aff extends JavaScriptObject {
protected Aff() {};
public static native Aff fromJSONString(String jsonString) /*-{
return eval('(' + jsonString + ')');
}-*/;
public final native String toJSON() /*-{
return this.toString();
}-*/;
// followed by get/seters and a bunch of TODO.
}
I am able to create and work with objects, but the obj.toJSON()
returns [object Object]
. I can't seem to find any way around this without doing a manual convert back into JSON.