示例#1
0
    @SuppressWarnings("unchecked")
    @Override
    public Map<?, ?> parse(Map<?, ?> map) {

      JSONBean jsonBean = (JSONBean) map.get(-2);
      String line = (String) map.get(map.get(-3));
      jsonBean.setAttributes(line.trim().replaceAll(" ", "").split((String) map.get(-1)));

      Map<Integer, Object> hashMap = new HashMap<Integer, Object>();
      hashMap = (Map<Integer, Object>) map;
      hashMap.put(-2, jsonBean);

      return hashMap;
    }
示例#2
0
    @SuppressWarnings("unchecked")
    @Override
    public Map<?, ?> parse(Map<?, ?> map) {

      String line = (String) map.get(map.get(-3));
      String[] values = line.trim().split((String) map.get(-1));

      JSONBean jsonBean = (JSONBean) map.get(-2);
      JSONObject jsonObject = new JSONObject();

      int i = 0;
      for (String attribute : jsonBean.getAttributes()) {
        jsonObject.put(attribute, values[i].trim());
        i++;
      }

      jsonBean.setJsonObject(jsonObject);

      Map<Integer, Object> hashMap = new HashMap<Integer, Object>();
      hashMap = (Map<Integer, Object>) map;
      hashMap.put(-2, jsonBean);

      return hashMap;
    }