CsvExportDescriptorXStreamProvider implements XStreamProvider<CsvExportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("export-descriptor", CsvExportDescriptorImpl.class); xStream.addDefaultImplementation(CsvExportDescriptorImpl.class, ExportDescriptor.class); xStream.addDefaultImplementation(CsvExportDescriptorImpl.class, CsvExportDescriptor.class); xStream.aliasField("entity-type", CsvExportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvExportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvExportContextImpl.class, CsvExportContext.class); xStream.aliasField("shop-code", CsvExportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvExportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvExportDescriptorImpl.class, "selectCmd"); xStream.aliasField("select-cmd", CsvExportDescriptorImpl.class, "selectCmd"); xStream.aliasField("export-file-descriptor", CsvExportDescriptorImpl.class, "exportFileDescriptor"); xStream.addDefaultImplementation(CsvExportFileImpl.class, CsvExportFile.class); xStream.aliasField("print-header", CsvExportFileImpl.class, "printHeader"); xStream.aliasField("column-delimiter", CsvExportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvExportFileImpl.class, "textQualifier"); xStream.aliasField("line-end", CsvExportFileImpl.class, "lineEnd"); xStream.aliasField("file-encoding", CsvExportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name", CsvExportFileImpl.class, "fileName"); xStream.aliasField("export-columns", CsvExportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvExportColumnImpl.class); xStream.aliasField("column-header", CsvExportColumnImpl.class, "columnHeader"); xStream.aliasField("field-type", CsvExportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvExportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvExportColumnImpl.class, "language"); xStream.aliasField("context", CsvExportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvExportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvExportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvExportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvExportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvExportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvExportColumnImpl.class, "useMasterObject"); xStream.aliasField("export-descriptor", CsvExportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvExportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; }  @Override CsvExportDescriptor fromXML(final String xml); @Override CsvExportDescriptor fromXML(final InputStream is); @Override String toXML(final CsvExportDescriptor object);  }
@Test public void testProvide() throws Exception { testProvide("src/test/resources/export/csv/schematest001.xml"); testProvide("src/test/resources/export/csv/schematest002.xml"); }