@Override protected JsonDatastore createDatastore(final String name, final Resource resource) { return new JsonDatastore(name, resource); }
private Datastore createDatastore(final String name, final JsonDatastoreType datastoreType, final DataCleanerConfiguration configuration) { final String filename = getStringVariable("filename", datastoreType.getFilename()); final Resource resource = _interceptor.createResource(filename, configuration); return new JsonDatastore(name, resource); }
/** * Creates a {@link Datastore} replacement to use for configured properties * * @param cb * @param datastore * @param replacementResource * @return a replacement datastore, or null if it shouldn't be replaced */ private ResourceDatastore createReplacementDatastore(final ComponentBuilder cb, final ResourceDatastore datastore, final Resource replacementResource) { final String name = datastore.getName(); if (datastore instanceof CsvDatastore) { final CsvConfiguration csvConfiguration = ((CsvDatastore) datastore).getCsvConfiguration(); return new CsvDatastore(name, replacementResource, csvConfiguration); } if (datastore instanceof JsonDatastore) { return new JsonDatastore(name, replacementResource, ((JsonDatastore) datastore).getSchemaBuilder()); } logger.warn("Could not replace datastore '{}' because it is of an unsupported type: ", name, datastore.getClass().getSimpleName()); return datastore; }
return new DbaseDatastore(datastoreName, resource.getQualifiedPath()); case JSON: return new JsonDatastore(datastoreName, resource); case OPENOFFICE: return new OdbDatastore(datastoreName, resource.getQualifiedPath());