JAVA 中 提取 JSON 字符串中的 KEY 和 VALUE 值

JSONObject jobj = JSONObject.fromObject(conditions == null ? "{}"
				: conditions);

		Iterator it = jobj.keys();

		String infotype = "FCCS";
		
		while (it.hasNext()) {

			String key = it.next().toString();

			// 将所有的空串去掉
			if (StringUtil.getString(jobj.getString(key)) == null) {

				continue;
			}

			if("infoType".equals(key)){      //试剂类型
				if("FCCS".equals(jobj.getString(key))){
					infotype = "FCCS";
				}else if("HS".equals(jobj.getString(key))){
					infotype = "HS";
				}
			}

你可能感兴趣的:(JSP/JAVA/J2EE)