@Test public void testXStreamFullConfigMarshall() throws Exception { try { AdapterXStreamMarshallerFactory factory = AdapterXStreamMarshallerFactory.getInstance(); XStream xstreamInstance = factory.createXStream(MarshallingOutput.JSON); Adapter standardAdapter = null; try (InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(XSTREAM_STANDARD_JSON)) { standardAdapter = (Adapter) xstreamInstance.fromXML(resourceAsStream); } XStreamMarshallerTest.adapterInstanceFieldChecks(standardAdapter); String standardMarshalledXML = xstreamInstance.toXML(standardAdapter); Adapter roundTripAdapter = (Adapter) xstreamInstance.fromXML(standardMarshalledXML); assertRoundtripEquality(standardAdapter, roundTripAdapter); } finally { AdapterXStreamMarshallerFactory.reset(); } }
@Override protected synchronized XStream getInstance(){ if (instance == null){ instance = AdapterXStreamMarshallerFactory.getInstance().createXStream(MarshallingOutput.JSON); } return instance; }
XStreamJsonMarshaller extends XStreamMarshallerImpl { @Override protected synchronized XStream getInstance(){ if (instance == null){ instance = AdapterXStreamMarshallerFactory.getInstance().createXStream(MarshallingOutput.JSON); } return instance; } }
XStreamJsonMarshaller extends XStreamMarshallerImpl { @Override protected synchronized XStream getInstance(){ if (instance == null){ instance = AdapterXStreamMarshallerFactory.getInstance().createXStream(MarshallingOutput.JSON); } return instance; } XStreamJsonMarshaller(); }
XStreamJsonMarshaller extends XStreamMarshallerImpl { @Override protected synchronized XStream getInstance(){ if (instance == null){ instance = AdapterXStreamMarshallerFactory.getInstance().createXStream(MarshallingOutput.JSON); } return instance; } XStreamJsonMarshaller();  }
XStreamJsonMarshaller extends XStreamMarshallerImpl { @Override protected synchronized XStream getInstance(){ if (instance == null){ instance = AdapterXStreamMarshallerFactory.getInstance().createXStream(MarshallingOutput.JSON); } return instance; } XStreamJsonMarshaller();   }