예제 #1
0
 public static ParameterSet fromJSONArray(JSONArray paramArray) throws JSONException, IOException {
   Object[] params = new Object[paramArray.length()];
   for (int i = 0; i < paramArray.length(); i++) {
     params[i] = paramFromPossibleJSON(paramArray.get(i));
   }
   return fromArrayNoCopy(params);
 }
예제 #2
0
 static Object paramFromPossibleJSON(Object value) throws JSONException, IOException {
   if (value instanceof JSONObject) {
     JSONObject jsonObj = (JSONObject) value;
     return VoltTable.fromJSONObject(jsonObj);
   }
   if (value instanceof JSONArray) {
     JSONArray array = (JSONArray) value;
     Object[] retval = new Object[array.length()];
     for (int i = 0; i < array.length(); i++) {
       Object valueAtIndex = array.get(i);
       retval[i] = paramFromPossibleJSON(valueAtIndex);
     }
     return retval;
   }
   return value;
 }