🎨 优化部分代码

This commit is contained in:
Binary Wang
2021-01-27 22:43:07 +08:00
parent c4a87961af
commit 6811bffa18
21 changed files with 142 additions and 131 deletions

View File

@ -14,6 +14,11 @@ import com.thoughtworks.xstream.security.WildcardTypePermission;
import java.io.Writer;
/**
* The type X stream initializer.
*
* @author Daniel Qian
*/
public class XStreamInitializer {
private static final XppDriver XPP_DRIVER = new XppDriver() {
@Override
@ -45,6 +50,11 @@ public class XStreamInitializer {
}
};
/**
* Gets instance.
*
* @return the instance
*/
public static XStream getInstance() {
XStream xstream = new XStream(new PureJavaReflectionProvider(), XPP_DRIVER) {
// only register the converters we need; other converters generate a private access warning in the console on Java9+...