/** * Construct a JSONObject from a subset of another JSONObject. An array of * strings is used to identify the keys that should be copied. Missing keys * are ignored. * * @param jo * A JSONObject. * @param names * An array of strings. * @throws JSONException * @exception JSONException * If a value is a non-finite number or if a name is * duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. An array of * strings is used to identify the keys that should be copied. Missing keys * are ignored. * * @param jo * A JSONObject. * @param names * An array of strings. */ public JSONObject(JSONObject jo, String[] names) { this(names.length); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
throw x.syntaxError("Expected a ':' after a key"); this.putOnce(key, x.nextValue());
/** * Construct a JSONObject from a subset of another JSONObject. An array of * strings is used to identify the keys that should be copied. Missing keys * are ignored. * * @param jo * A JSONObject. * @param names * An array of strings. */ public JSONObject(JSONObject jo, String[] names) { this(names.length); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) throws JSONException { this(); for (int i = 0; i < names.length; i += 1) { putOnce(names[i], jo.opt(names[i])); } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) throws JSONException { this(); for (int i = 0; i < names.length; i += 1) { putOnce(names[i], jo.opt(names[i])); } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) throws JSONException { this(); for (int i = 0; i < names.length; i += 1) { putOnce(names[i], jo.opt(names[i])); } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. */ public JSONObject(JSONObject jo, String[] names) throws JSONException { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * * @param key * @param value * @return this GfJsonObject * @throws GfJsonException * if the key is a duplicate */ public GfJsonObject putOnce(String key, Object value) throws GfJsonException { try { jsonObject.putOnce(key, value); } catch (JSONException e) { throw new GfJsonException(e.getMessage()); } return this; }
/** * * @param key * @param value * @return this GfJsonObject * @throws GfJsonException * if the key is a duplicate */ public GfJsonObject putOnce(String key, Object value) throws GfJsonException { try { jsonObject.putOnce(key, value); } catch (JSONException e) { throw new GfJsonException(e.getMessage()); } return this; }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. An array of * strings is used to identify the keys that should be copied. Missing keys * are ignored. * * @param jo * A JSONObject. * @param names * An array of strings. */ public JSONObject(JSONObject jo, String[] names) { this(names.length); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { putOnce(names[i].toLowerCase(), jo.opt(names[i])); } catch (Exception ignore) { } } }
/** * Construct a JSONObject from a subset of another JSONObject. * An array of strings is used to identify the keys that should be copied. * Missing keys are ignored. * @param jo A JSONObject. * @param names An array of strings. * @throws JSONException * @exception JSONException If a value is a non-finite number or if a name is duplicated. */ public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } }