@Test public void testProvide() throws Exception { testProvide("src/test/resources/import/csv/schematest001.xml"); testProvide("src/test/resources/import/csv/schematest002.xml"); }
private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("import-descriptor", CsvImportDescriptorImpl.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, ImportDescriptor.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, CsvImportDescriptor.class); xStream.aliasField("mode", CsvImportDescriptorImpl.class, "mode"); xStream.aliasField("entity-type", CsvImportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvImportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvImportContextImpl.class, CsvImportContext.class); xStream.aliasField("shop-code", CsvImportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvImportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-sql", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-sql", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("select-cmd", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-cmd", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-cmd", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("import-file-descriptor", CsvImportDescriptorImpl.class, "importFileDescriptor"); xStream.addDefaultImplementation(CsvImportFileImpl.class, CsvImportFile.class); xStream.aliasField("ignore-first-line", CsvImportFileImpl.class, "ignoreFirstLine"); xStream.aliasField("column-delimiter", CsvImportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvImportFileImpl.class, "textQualifier"); xStream.aliasField("file-encoding", CsvImportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name-mask", CsvImportFileImpl.class, "fileNameMask"); xStream.aliasField("import-columns", CsvImportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvImportColumnImpl.class); xStream.aliasField("column-index", CsvImportColumnImpl.class, "columnIndex"); xStream.aliasField("field-type", CsvImportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvImportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvImportColumnImpl.class, "language"); xStream.aliasField("context", CsvImportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvImportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvImportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvImportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvImportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvImportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvImportColumnImpl.class, "useMasterObject"); xStream.aliasField("insert-only", CsvImportColumnImpl.class, "insertOnly"); xStream.aliasField("update-only", CsvImportColumnImpl.class, "updateOnly"); xStream.aliasField("update-skip-unresolved", CsvImportColumnImpl.class, "skipUpdateForUnresolved"); xStream.aliasField("import-descriptor", CsvImportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvImportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; }
CsvImportDescriptorXStreamProvider implements XStreamProvider<CsvImportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("import-descriptor", CsvImportDescriptorImpl.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, ImportDescriptor.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, CsvImportDescriptor.class); xStream.aliasField("mode", CsvImportDescriptorImpl.class, "mode"); xStream.aliasField("entity-type", CsvImportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvImportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvImportContextImpl.class, CsvImportContext.class); xStream.aliasField("shop-code", CsvImportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvImportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-sql", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-sql", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("select-cmd", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-cmd", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-cmd", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("import-file-descriptor", CsvImportDescriptorImpl.class, "importFileDescriptor"); xStream.addDefaultImplementation(CsvImportFileImpl.class, CsvImportFile.class); xStream.aliasField("ignore-first-line", CsvImportFileImpl.class, "ignoreFirstLine"); xStream.aliasField("column-delimiter", CsvImportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvImportFileImpl.class, "textQualifier"); xStream.aliasField("file-encoding", CsvImportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name-mask", CsvImportFileImpl.class, "fileNameMask"); xStream.aliasField("import-columns", CsvImportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvImportColumnImpl.class); xStream.aliasField("column-index", CsvImportColumnImpl.class, "columnIndex"); xStream.aliasField("field-type", CsvImportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvImportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvImportColumnImpl.class, "language"); xStream.aliasField("context", CsvImportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvImportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvImportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvImportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvImportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvImportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvImportColumnImpl.class, "useMasterObject"); xStream.aliasField("insert-only", CsvImportColumnImpl.class, "insertOnly"); xStream.aliasField("update-only", CsvImportColumnImpl.class, "updateOnly"); xStream.aliasField("update-skip-unresolved", CsvImportColumnImpl.class, "skipUpdateForUnresolved"); xStream.aliasField("import-descriptor", CsvImportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvImportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; } }
CsvImportDescriptorXStreamProvider implements XStreamProvider<CsvImportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("import-descriptor", CsvImportDescriptorImpl.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, ImportDescriptor.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, CsvImportDescriptor.class); xStream.aliasField("mode", CsvImportDescriptorImpl.class, "mode"); xStream.aliasField("entity-type", CsvImportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvImportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvImportContextImpl.class, CsvImportContext.class); xStream.aliasField("shop-code", CsvImportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvImportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-sql", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-sql", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("select-cmd", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-cmd", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-cmd", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("import-file-descriptor", CsvImportDescriptorImpl.class, "importFileDescriptor"); xStream.addDefaultImplementation(CsvImportFileImpl.class, CsvImportFile.class); xStream.aliasField("ignore-first-line", CsvImportFileImpl.class, "ignoreFirstLine"); xStream.aliasField("column-delimiter", CsvImportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvImportFileImpl.class, "textQualifier"); xStream.aliasField("file-encoding", CsvImportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name-mask", CsvImportFileImpl.class, "fileNameMask"); xStream.aliasField("import-columns", CsvImportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvImportColumnImpl.class); xStream.aliasField("column-index", CsvImportColumnImpl.class, "columnIndex"); xStream.aliasField("field-type", CsvImportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvImportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvImportColumnImpl.class, "language"); xStream.aliasField("context", CsvImportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvImportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvImportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvImportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvImportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvImportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvImportColumnImpl.class, "useMasterObject"); xStream.aliasField("insert-only", CsvImportColumnImpl.class, "insertOnly"); xStream.aliasField("update-only", CsvImportColumnImpl.class, "updateOnly"); xStream.aliasField("update-skip-unresolved", CsvImportColumnImpl.class, "skipUpdateForUnresolved"); xStream.aliasField("import-descriptor", CsvImportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvImportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; }  }
CsvImportDescriptorXStreamProvider implements XStreamProvider<CsvImportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("import-descriptor", CsvImportDescriptorImpl.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, ImportDescriptor.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, CsvImportDescriptor.class); xStream.aliasField("mode", CsvImportDescriptorImpl.class, "mode"); xStream.aliasField("entity-type", CsvImportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvImportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvImportContextImpl.class, CsvImportContext.class); xStream.aliasField("shop-code", CsvImportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvImportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-sql", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-sql", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("select-cmd", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-cmd", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-cmd", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("import-file-descriptor", CsvImportDescriptorImpl.class, "importFileDescriptor"); xStream.addDefaultImplementation(CsvImportFileImpl.class, CsvImportFile.class); xStream.aliasField("ignore-first-line", CsvImportFileImpl.class, "ignoreFirstLine"); xStream.aliasField("column-delimiter", CsvImportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvImportFileImpl.class, "textQualifier"); xStream.aliasField("file-encoding", CsvImportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name-mask", CsvImportFileImpl.class, "fileNameMask"); xStream.aliasField("import-columns", CsvImportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvImportColumnImpl.class); xStream.aliasField("column-index", CsvImportColumnImpl.class, "columnIndex"); xStream.aliasField("field-type", CsvImportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvImportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvImportColumnImpl.class, "language"); xStream.aliasField("context", CsvImportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvImportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvImportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvImportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvImportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvImportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvImportColumnImpl.class, "useMasterObject"); xStream.aliasField("insert-only", CsvImportColumnImpl.class, "insertOnly"); xStream.aliasField("update-only", CsvImportColumnImpl.class, "updateOnly"); xStream.aliasField("update-skip-unresolved", CsvImportColumnImpl.class, "skipUpdateForUnresolved"); xStream.aliasField("import-descriptor", CsvImportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvImportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; }  @Override CsvImportDescriptor fromXML(final String xml); @Override CsvImportDescriptor fromXML(final InputStream is); @Override String toXML(final CsvImportDescriptor object); }
CsvImportDescriptorXStreamProvider implements XStreamProvider<CsvImportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("import-descriptor", CsvImportDescriptorImpl.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, ImportDescriptor.class); xStream.addDefaultImplementation(CsvImportDescriptorImpl.class, CsvImportDescriptor.class); xStream.aliasField("mode", CsvImportDescriptorImpl.class, "mode"); xStream.aliasField("entity-type", CsvImportDescriptorImpl.class, "entityType"); xStream.aliasField("context", CsvImportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(CsvImportContextImpl.class, CsvImportContext.class); xStream.aliasField("shop-code", CsvImportContextImpl.class, "shopCode"); xStream.aliasField("shop-code-column", CsvImportContextImpl.class, "shopCodeColumn"); xStream.aliasField("select-sql", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-sql", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-sql", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("select-cmd", CsvImportDescriptorImpl.class, "selectCmd"); xStream.aliasField("insert-cmd", CsvImportDescriptorImpl.class, "insertCmd"); xStream.aliasField("delete-cmd", CsvImportDescriptorImpl.class, "deleteCmd"); xStream.aliasField("import-file-descriptor", CsvImportDescriptorImpl.class, "importFileDescriptor"); xStream.addDefaultImplementation(CsvImportFileImpl.class, CsvImportFile.class); xStream.aliasField("ignore-first-line", CsvImportFileImpl.class, "ignoreFirstLine"); xStream.aliasField("column-delimiter", CsvImportFileImpl.class, "columnDelimiter"); xStream.aliasField("text-qualifier", CsvImportFileImpl.class, "textQualifier"); xStream.aliasField("file-encoding", CsvImportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name-mask", CsvImportFileImpl.class, "fileNameMask"); xStream.aliasField("import-columns", CsvImportDescriptorImpl.class, "columns"); xStream.addDefaultImplementation(ArrayList.class, Collection.class); xStream.alias("column-descriptor", CsvImportColumnImpl.class); xStream.aliasField("column-index", CsvImportColumnImpl.class, "columnIndex"); xStream.aliasField("field-type", CsvImportColumnImpl.class, "fieldType"); xStream.aliasField("data-type", CsvImportColumnImpl.class, "dataType"); xStream.aliasField("language", CsvImportColumnImpl.class, "language"); xStream.aliasField("context", CsvImportColumnImpl.class, "context"); xStream.aliasField("value-regex", CsvImportColumnImpl.class, "valueRegEx"); xStream.aliasField("value-regex-group", CsvImportColumnImpl.class, "valueRegExGroup"); xStream.aliasField("value-regex-template", CsvImportColumnImpl.class, "valueRegExTemplate"); xStream.aliasField("lookup-query", CsvImportColumnImpl.class, "lookupQuery"); xStream.aliasField("value-constant", CsvImportColumnImpl.class, "valueConstant"); xStream.aliasField("use-master-object", CsvImportColumnImpl.class, "useMasterObject"); xStream.aliasField("insert-only", CsvImportColumnImpl.class, "insertOnly"); xStream.aliasField("update-only", CsvImportColumnImpl.class, "updateOnly"); xStream.aliasField("update-skip-unresolved", CsvImportColumnImpl.class, "skipUpdateForUnresolved"); xStream.aliasField("import-descriptor", CsvImportColumnImpl.class, "descriptor"); xStream.aliasField("entity-type", CsvImportColumnImpl.class, "entityType"); this.xStream = xStream; } return this.xStream; }  @Override CsvImportDescriptor fromXML(final String xml); @Override CsvImportDescriptor fromXML(final InputStream is); @Override String toXML(final CsvImportDescriptor object);  }