mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-14 02:05:12 +08:00
优化代码
* 错别字 * long l->L * 使xml中不存在的属性不会把java bean中已有的属性覆盖成null 比如:me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage#accessTokenLock
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package me.chanjar.weixin.common.util.xml;
|
||||
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
|
||||
import com.thoughtworks.xstream.core.util.QuickWriter;
|
||||
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
||||
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
|
||||
@@ -13,7 +14,7 @@ import java.io.Writer;
|
||||
public class XStreamInitializer {
|
||||
|
||||
public static XStream getInstance() {
|
||||
XStream xstream = new XStream(new XppDriver() {
|
||||
XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver() {
|
||||
|
||||
@Override
|
||||
public HierarchicalStreamWriter createWriter(Writer out) {
|
||||
@@ -42,6 +43,7 @@ public class XStreamInitializer {
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
xstream.ignoreUnknownElements();
|
||||
xstream.setMode(XStream.NO_REFERENCES);
|
||||
xstream.addPermission(NullPermission.NULL);
|
||||
|
Reference in New Issue
Block a user