Passing an arbitrary JSONValue to a JSNI function
- by Riley Lark
I have a JSONValue in my Java that may be a JSONArray, a JSONObject, a JSONString, etc. I want to pass it to a JSNI function that can accept any of those types. If I naively write my JSNI as something like:
public final native jsni(Object parameter) /*-{
doSomething(parameter);
}-*/;
public void useFunction(JSONValue value) {
…