- /**\r
- * Determines whether or not the supplied text string represents a valid\r
- * JSON structure or not.\r
- * \r
- * @param text - The text to be evaluated.\r
- * \r
- * @return - true if the string represents a valid JSON object,\r
- * false, otherwise.\r
- */\r
- public static boolean isValidJson(String text) {\r
- try {\r
- new JSONObject(text);\r
- } catch (JSONException ex) {\r
- try {\r
- new JSONArray(text);\r
- } catch (JSONException ex1) {\r
- return false;\r
- }\r