Java Code Examples for com.alibaba.fastjson.JSONObject#getInnerMap()
The following examples show how to use
com.alibaba.fastjson.JSONObject#getInnerMap() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RestUtil.java From jeecg-cloud with Apache License 2.0 | 6 votes |
/** * 将 JSONObject 转为 a=1&b=2&c=3...&n=n 的形式 */ public static String asUrlVariables(JSONObject variables) { Map<String, Object> source = variables.getInnerMap(); Iterator<String> it = source.keySet().iterator(); StringBuilder urlVariables = new StringBuilder(); while (it.hasNext()) { String key = it.next(); String value = ""; Object object = source.get(key); if (object != null) { if (!StringUtils.isEmpty(object.toString())) { value = object.toString(); } } urlVariables.append("&").append(key).append("=").append(value); } // 去掉第一个& return urlVariables.substring(1); }
Example 2
Source File: RestUtil.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 将 JSONObject 转为 a=1&b=2&c=3...&n=n 的形式 */ public static String asUrlVariables(JSONObject variables) { Map<String, Object> source = variables.getInnerMap(); Iterator<String> it = source.keySet().iterator(); StringBuilder urlVariables = new StringBuilder(); while (it.hasNext()) { String key = it.next(); String value = ""; Object object = source.get(key); if (object != null) { if (!StringUtils.isEmpty(object.toString())) { value = object.toString(); } } urlVariables.append("&").append(key).append("=").append(value); } // 去掉第一个& return urlVariables.substring(1); }
Example 3
Source File: RestUtil.java From teaching with Apache License 2.0 | 6 votes |
/** * 将 JSONObject 转为 a=1&b=2&c=3...&n=n 的形式 */ public static String asUrlVariables(JSONObject variables) { Map<String, Object> source = variables.getInnerMap(); Iterator<String> it = source.keySet().iterator(); StringBuilder urlVariables = new StringBuilder(); while (it.hasNext()) { String key = it.next(); String value = ""; Object object = source.get(key); if (object != null) { if (!StringUtils.isEmpty(object.toString())) { value = object.toString(); } } urlVariables.append("&").append(key).append("=").append(value); } // 去掉第一个& return urlVariables.substring(1); }
Example 4
Source File: RestUtil.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 将 JSONObject 转为 a=1&b=2&c=3...&n=n 的形式 */ public static String asUrlVariables(JSONObject variables) { Map<String, Object> source = variables.getInnerMap(); Iterator<String> it = source.keySet().iterator(); StringBuilder urlVariables = new StringBuilder(); while (it.hasNext()) { String key = it.next(); String value = ""; Object object = source.get(key); if (object != null) { if (!StringUtils.isEmpty(object.toString())) { value = object.toString(); } } urlVariables.append("&").append(key).append("=").append(value); } // 去掉第一个& return urlVariables.substring(1); }
Example 5
Source File: Props.java From liteflow with Apache License 2.0 | 5 votes |
/** * json * @param json */ public Props(String json) { Map<String, String> map = Maps.newHashMap(); if(StringUtils.isNotBlank(json)){ JSONObject propObj = JSONObject.parseObject(json); Map<String, Object> innerMap = propObj.getInnerMap(); for(Map.Entry<String, Object> mapKV : innerMap.entrySet()){ map.put(mapKV.getKey(), String.valueOf(mapKV.getValue())); } } this.paramMap = map; }