优化解析XML遇到无法识别的节点的兼容

pull/1669/head
648540858 2024-10-29 15:06:08 +08:00
parent ace7b78498
commit caf9e99939
1 changed files with 19 additions and 14 deletions

View File

@ -706,6 +706,7 @@ public class XmlUtil {
* @return
*/
private static Object simpleTypeDeal(Class<?> tClass, Object val) {
try {
if (val == null || val.toString().equalsIgnoreCase("null")) {
return null;
}
@ -717,10 +718,14 @@ public class XmlUtil {
}
if (tClass.equals(Double.class)) {
return Double.valueOf(val.toString());
}
if (tClass.equals(Long.class)) {
return Long.valueOf(val.toString());
}
return val;
}catch (Exception e) {
return null;
}
}
}