@Override public EwJsonCollection optJSONCollection(Object ref, EwJsonCollection defaultValue) { return EwJson.tryConvert(this.opt(ref)); }
@Override public EwJsonCollection optJSONCollection(Object ref, EwJsonCollection defaultValue) { return EwJson.tryConvert(this.opt(ref)); }
@Override public EwJsonCollection getJSONCollection(Object ref) throws JSONException { final EwJsonCollection collection = EwJson.tryConvert(this.opt(ref)); if (collection != null) return collection; else throw buildGetterException(ref, "is not an EwJsonCollection"); }
@Override public EwJsonCollection getJSONCollection(Object ref) throws JSONException { final EwJsonCollection collection = EwJson.tryConvert(this.opt(ref)); if (collection != null) return collection; else throw buildGetterException(ref, "is not an EwJsonCollection"); }
@Deprecated public static EwJsonCollection tryMerge(Object into, Object from, Object ref) { if (isJson(into)) { final EwJsonCollection converted = tryConvert(into); try { if (converted instanceof JSONArray) return EwJsonArray.tryMergeAny((JSONArray) converted, from, ref); if (converted instanceof JSONObject) return EwJsonObject.tryMergeAny((JSONObject) converted, from, ref); } catch (JSONException je) { } } return null; }
final EwJsonCollection json = EwJson.tryConvert(result);
@Override public Object resolve(Context c, Map<String, String[]> parameters, Map<String, InputStream> dataStreams) throws JSONException { final boolean optEmpty = optAsBoolean("optEmpty", false, c, parameters, dataStreams); final Object obj = get("obj", c, parameters, dataStreams); if (has("opt") == false) { for (String key : keySet()) if (!key.equals("obj")) if (obj instanceof JSONObject) if (((JSONObject)obj).has(key)) return ((JSONObject)obj).get(key); } else if (obj == null) { Object object = get("opt",c, parameters, dataStreams); return object; } else if (optEmpty && EwJson.isJson(obj)) { final EwJsonCollection json = EwJson.tryConvert(obj); if (json != null && json.isEmpty()) return get("opt",c, parameters, dataStreams); } return obj; }
return EwJsonObject.merge(converted, EwJson.tryConvert(wrapped), ref);