记得上下班打卡 | git大法好,push需谨慎

Commit a6654c04 authored by zhengfuxin's avatar zhengfuxin

修改忽略字段。

parent 0f706dc7
......@@ -66,6 +66,7 @@ public class XmlUtil{
public static <T> T toBean(String xmlStr,Class<T> cls){
//注意:不是new Xstream(); 否则报错:java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserFactory
XStream xstream=new XStream(new DomDriver());
xstream.ignoreUnknownElements();
xstream.processAnnotations(cls);
T obj=(T)xstream.fromXML(xmlStr);
return obj;
......
......@@ -66,6 +66,7 @@ public class XmlUtil{
public static <T> T toBean(String xmlStr,Class<T> cls){
//注意:不是new Xstream(); 否则报错:java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserFactory
XStream xstream=new XStream(new DomDriver());
xstream.ignoreUnknownElements();
xstream.processAnnotations(cls);
T obj=(T)xstream.fromXML(xmlStr);
return obj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment