Class JSONUtil


  • public class JSONUtil
    extends Object
    • Constructor Detail

      • JSONUtil

        public JSONUtil()
    • Method Detail

      • isJDKClass

        public static <T> boolean isJDKClass​(T t)
      • getJSONObjectFromObject

        public static Object getJSONObjectFromObject​(Object object)
      • getMapFromJSONObject

        public static HashMap<String,​Object> getMapFromJSONObject​(org.json.JSONObject object,
                                                                        String key)
                                                                 throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getMapFromJSONObject

        public static HashMap<String,​Object> getMapFromJSONObject​(org.json.JSONObject object)
                                                                 throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getListFromJSONArray

        public static ArrayList<Object> getListFromJSONArray​(org.json.JSONArray array)
                                                      throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getObjectFromJSON

        public static Object getObjectFromJSON​(Object json)
                                        throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getJSONFromXML

        public static org.json.JSONObject getJSONFromXML​(String xml)
      • getXMLFromJSON

        public static String getXMLFromJSON​(Object obj)
      • getJSONObjectFromJSONString

        public static org.json.JSONObject getJSONObjectFromJSONString​(String json)
      • getJSONArrayFromJSONString

        public static org.json.JSONArray getJSONArrayFromJSONString​(String json)
      • getMap

        public static Map<String,​Object> getMap​(org.json.JSONObject jsonObject)
      • getList

        public static List<Object> getList​(org.json.JSONArray array)
      • getListFromJSONArray

        public static List<Object> getListFromJSONArray​(String json)
      • getJsonStringFromObject

        public static String getJsonStringFromObject​(Object cache)
      • getJsonStringFromCollection

        public static String getJsonStringFromCollection​(Collection<? extends Object> cache)
      • getJsonStringFromMap

        public static String getJsonStringFromMap​(Map<?,​?> cache)
      • toList

        public static List<Object> toList​(org.json.JSONArray array)
      • toMap

        public static Map<?,​?> toMap​(org.json.JSONObject object)