用到的包只有 org.json.jar,用法如下 /** * JSON辅助类 * @author zx * */ public class JsonUtils { /** *@description: 根据给定json串解析出内部属性 *@param json串 *@return 属性Map */ public static Map<String,String> parseProperties(String jsonStr){ if(jsonStr ==null || jsonStr.length()<5){ return null; } JSONObject jsonObj = null; Map<String, String> pros = new HashMap<String, String>(); try { jsonObj = new JSONObject(jsonStr); Iterator it = jsonObj.keys(); while(it.hasNext()){ String key = it.next().toString(); String value = jsonObj.getString(key); pros.put(key, value); } } catch (JSONException e) { e.printStackTrace(); } return pros; } public static void main(String[] args){ String titleRule = "{color:/"#264989/",size:5}"; JsonUtils ju = new JsonUtils(); Map<String, String> pros = ju.parseProperties(titleRule); Iterator its = pros.keySet().iterator(); while(its.hasNext()){ String key = its.next().toString(); System.out.println(key + ":" + pros.get(key)); } } } 通过对JSONObject对象的key集合迭代可获取相应的属性. jar包下载地址: http://download.csdn.net/source/3099546