Package cn.baiweigang.qtaf.toolkit.util

Examples of cn.baiweigang.qtaf.toolkit.util.JsonUtil


   * @return Map<String, String> ,返回整理后的实际结果
   */
  private Map<String, String> trimActres(String responseRes,int config) {
    Map<String, String> trimactres = new TreeMap<String, String>();
    Map<String, Object> map = new TreeMap<String,Object>();
    JsonUtil json = new JsonUtil();
    if (responseRes.contains("<?xml") && responseRes.indexOf("<?xml")<1) {//此处xml格式文本判断不严谨,有待优化
      trimactres = XmlUtil.fomatXMLToMap(responseRes);
      if (trimactres.size()<1) {
        trimactres.put("解析xml格式错误", "---"+responseRes);
      }
    } else{
      if(config == 1){//单层方式解析json串
        map = json.getResult(responseRes);
      }else if(config == 2){//多层方式解析json串
        map = json.getAllResult(responseRes);
      }else{//config不为1、2时  按单层方式解析
        map = json.getResult(responseRes);
      }
      if(map == null){
        trimactres.put("解析json格式错误", "---"+responseRes);
        return trimactres;
      }
View Full Code Here

TOP

Related Classes of cn.baiweigang.qtaf.toolkit.util.JsonUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.