Browse Source

REPORT-2343 [代码质量]=>去掉无用代码

master
plough 8 years ago
parent
commit
aa379c8994
  1. 45
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

45
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -397,51 +397,6 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable, XM
return isTestTemplate; return isTestTemplate;
} }
public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException {
Map<String, Object> retMap = new HashMap<>();
if(json != JSONObject.NULL) {
retMap = toMap(json);
}
return retMap;
}
private static Map<String, Object> toMap(JSONObject object) throws JSONException {
Map<String, Object> map = new HashMap<>();
Iterator<String> keysItr = object.keys();
while(keysItr.hasNext()) {
String key = keysItr.next();
Object value = object.get(key);
if(value instanceof JSONArray) {
value = toList((JSONArray) value);
}
else if(value instanceof JSONObject) {
value = toMap((JSONObject) value);
}
map.put(key, value);
}
return map;
}
private static List<Object> toList(JSONArray array) throws JSONException {
List<Object> list = new ArrayList<>();
for(int i = 0; i < array.length(); i++) {
Object value = array.get(i);
if(value instanceof JSONArray) {
value = toList((JSONArray) value);
}
else if(value instanceof JSONObject) {
value = toMap((JSONObject) value);
}
list.add(value);
}
return list;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void readXML(XMLableReader reader) { public void readXML(XMLableReader reader) {

Loading…
Cancel
Save