Java Code Examples for org.mozilla.javascript.NativeJSON#parse()

The following examples show how to use org.mozilla.javascript.NativeJSON#parse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DetermineBasalAdapterSMBJS.java    From AndroidAPS with GNU Affero General Public License v3.0 4 votes vote down vote up
private Object makeParamArray(JSONArray jsonArray, Context rhino, Scriptable scope) {
    //Object param = NativeJSON.parse(rhino, scope, "{myarray: " + jsonArray.toString() + " }", new Callable() {
    Object param = NativeJSON.parse(rhino, scope, jsonArray.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
    return param;
}
 
Example 2
Source File: DetermineBasalAdapterAMAJS.java    From AndroidAPS with GNU Affero General Public License v3.0 4 votes vote down vote up
private Object makeParamArray(JSONArray jsonArray, Context rhino, Scriptable scope) {
    //Object param = NativeJSON.parse(rhino, scope, "{myarray: " + jsonArray.toString() + " }", new Callable() {
    Object param = NativeJSON.parse(rhino, scope, jsonArray.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
    return param;
}
 
Example 3
Source File: DetermineBasalAdapterMAJS.java    From AndroidAPS with GNU Affero General Public License v3.0 4 votes vote down vote up
private Object makeParam(JSONObject jsonObject, Context rhino, Scriptable scope) {
    Object param = NativeJSON.parse(rhino, scope, jsonObject.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
    return param;
}
 
Example 4
Source File: DetermineBasalAdapterSMBJS.java    From AndroidAPS with GNU Affero General Public License v3.0 3 votes vote down vote up
private Object makeParam(JSONObject jsonObject, Context rhino, Scriptable scope) {

        if (jsonObject == null) return Undefined.instance;

        Object param = NativeJSON.parse(rhino, scope, jsonObject.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
        return param;
    }
 
Example 5
Source File: DetermineBasalAdapterAMAJS.java    From AndroidAPS with GNU Affero General Public License v3.0 3 votes vote down vote up
private Object makeParam(JSONObject jsonObject, Context rhino, Scriptable scope) {

        if (jsonObject == null) return Undefined.instance;

        Object param = NativeJSON.parse(rhino, scope, jsonObject.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
        return param;
    }