Java Code Examples for com.alibaba.fastjson.JSONObject#getInnerMap()

The following examples show how to use com.alibaba.fastjson.JSONObject#getInnerMap() . These examples are extracted from open source projects. 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 Project: jeecg-cloud   File: RestUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 将 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 Project: jeecg-boot-with-activiti   File: RestUtil.java    License: MIT License 6 votes vote down vote up
/**
 * 将 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 Project: teaching   File: RestUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 将 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 Project: jeecg-boot   File: RestUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 将 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 Project: liteflow   File: Props.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}