@Deprecated public static boolean hasComplexKey(Object object, String key) throws JSONException { final Object json = tryParseJson(object, true); if (!isComplexKey(key) || !isJson(json)) return false; return (processComplexKey(json, KEY_PATTERN.split(key)).size() > 0); }
@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; }
@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; }
if (EwJson.isJson(existing)) EwJson.tryMerge(existing, from, null); else
if (EwJson.isJson(wrapped)) return EwJsonObject.merge(converted, EwJson.tryConvert(wrapped), ref);
EwJson.merge(into, (JSONArray) from, 0, putDex, from.length()); else if (!EwJson.isJson(from) || EwJson.getElements(from) > 0) into.put(putDex, from);
if (isJson(innerValue)) results.add(innerValue);