@Deprecated public static Object tryParseJson(Object object, boolean nullify, boolean reduce) { if (isNull(object)) return null; final JSONArray ja = getInstanceOfJsonArray(object); if (ja != null) return (reduce) ? tryReduce(ja, nullify) : ja; final JSONObject jo = getInstanceOfJsonObject(object); if (jo != null) return (reduce) ? tryReduce(jo, nullify) : jo; return (nullify) ? null : object; }
/** Cast or parse object as JSON object, or return the object */ private static Object cast(Object o) throws JSONException { JSONArray ja = EwJson.getInstanceOfJsonArray(o); if (ja != null) return create(ja); JSONObject jo = EwJson.getInstanceOfJsonObject(o); if (jo != null) return create(jo); if (o instanceof Cruncher) return create((Cruncher) o); return o; }