2016-03-31 17:50:47 +05:30
|
|
|
package com.baeldung.initializer;
|
|
|
|
|
|
|
|
import com.thoughtworks.xstream.XStream;
|
|
|
|
|
|
|
|
public class SimpleXstreamInitializer {
|
|
|
|
|
2016-04-01 17:43:37 +05:30
|
|
|
private XStream xtreamInstance;
|
2016-03-31 17:50:47 +05:30
|
|
|
|
2016-04-01 17:43:37 +05:30
|
|
|
public XStream getXstreamInstance() {
|
2016-03-31 17:50:47 +05:30
|
|
|
if (xtreamInstance == null) {
|
|
|
|
synchronized (SimpleXstreamInitializer.class) {
|
|
|
|
if (xtreamInstance == null) {
|
|
|
|
xtreamInstance = new XStream();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return xtreamInstance;
|
|
|
|
}
|
|
|
|
}
|