diff --git a/core/src/main/java/io/xpipe/core/source/CollectionDataSource.java b/core/src/main/java/io/xpipe/core/source/CollectionDataSource.java index 9c9ad7570..a88ced22b 100644 --- a/core/src/main/java/io/xpipe/core/source/CollectionDataSource.java +++ b/core/src/main/java/io/xpipe/core/source/CollectionDataSource.java @@ -5,7 +5,7 @@ import io.xpipe.core.store.DataStore; import java.util.HashMap; import java.util.Map; -public abstract class CollectionDataSource extends DataSourceDescriptor { +public abstract class CollectionDataSource extends DataSource { private final Map preferredProviders; diff --git a/core/src/main/java/io/xpipe/core/source/DataSource.java b/core/src/main/java/io/xpipe/core/source/DataSource.java index 1de157e02..8154137a5 100644 --- a/core/src/main/java/io/xpipe/core/source/DataSource.java +++ b/core/src/main/java/io/xpipe/core/source/DataSource.java @@ -10,15 +10,15 @@ import java.util.Optional; * * This instance is only valid in combination with its associated data store instance. */ -public abstract class DataSourceDescriptor { +public abstract class DataSource { protected DS store; - public DataSourceDescriptor(DS store) { + public DataSource(DS store) { this.store = store; } - public DataSourceDescriptor withStore(DS newStore) { + public DataSource withStore(DS newStore) { return null; } @@ -26,7 +26,7 @@ public abstract class DataSourceDescriptor { * Casts this instance to the required type without checking whether a cast is possible. */ @SuppressWarnings("unchecked") - public final > DSD asNeeded() { + public final > DSD asNeeded() { return (DSD) this; } diff --git a/core/src/main/java/io/xpipe/core/source/RawDataSource.java b/core/src/main/java/io/xpipe/core/source/RawDataSource.java index 1a5294f11..1ed85f820 100644 --- a/core/src/main/java/io/xpipe/core/source/RawDataSource.java +++ b/core/src/main/java/io/xpipe/core/source/RawDataSource.java @@ -2,11 +2,11 @@ package io.xpipe.core.source; import io.xpipe.core.store.DataStore; -public abstract class RawDataSourceDescriptor extends DataSourceDescriptor { +public abstract class RawDataSource extends DataSource { private static final int MAX_BYTES_READ = 100000; - public RawDataSourceDescriptor(DS store) { + public RawDataSource(DS store) { super(store); } diff --git a/core/src/main/java/io/xpipe/core/source/StructureDataSource.java b/core/src/main/java/io/xpipe/core/source/StructureDataSource.java index c6f6bf92c..778989f38 100644 --- a/core/src/main/java/io/xpipe/core/source/StructureDataSource.java +++ b/core/src/main/java/io/xpipe/core/source/StructureDataSource.java @@ -3,9 +3,9 @@ package io.xpipe.core.source; import io.xpipe.core.data.node.DataStructureNode; import io.xpipe.core.store.DataStore; -public abstract class StructureDataSourceDescriptor extends DataSourceDescriptor { +public abstract class StructureDataSource extends DataSource { - public StructureDataSourceDescriptor(DS store) { + public StructureDataSource(DS store) { super(store); } diff --git a/core/src/main/java/io/xpipe/core/source/TableDataSource.java b/core/src/main/java/io/xpipe/core/source/TableDataSource.java index 1a77b9d88..de640f356 100644 --- a/core/src/main/java/io/xpipe/core/source/TableDataSource.java +++ b/core/src/main/java/io/xpipe/core/source/TableDataSource.java @@ -2,9 +2,9 @@ package io.xpipe.core.source; import io.xpipe.core.store.DataStore; -public abstract class TableDataSourceDescriptor extends DataSourceDescriptor { +public abstract class TableDataSource extends DataSource { - public TableDataSourceDescriptor(DS store) { + public TableDataSource(DS store) { super(store); } diff --git a/core/src/main/java/io/xpipe/core/source/TextDataSource.java b/core/src/main/java/io/xpipe/core/source/TextDataSource.java index 7f3c1f3c0..a42586f58 100644 --- a/core/src/main/java/io/xpipe/core/source/TextDataSource.java +++ b/core/src/main/java/io/xpipe/core/source/TextDataSource.java @@ -2,11 +2,11 @@ package io.xpipe.core.source; import io.xpipe.core.store.DataStore; -public abstract class TextDataSourceDescriptor extends DataSourceDescriptor { +public abstract class TextDataSource extends DataSource { private static final int MAX_LINE_READ = 1000; - public TextDataSourceDescriptor(DS store) { + public TextDataSource(DS store) { super(store); } diff --git a/core/src/main/java/io/xpipe/core/store/DataStore.java b/core/src/main/java/io/xpipe/core/store/DataStore.java index befc70ba8..173c77982 100644 --- a/core/src/main/java/io/xpipe/core/store/DataStore.java +++ b/core/src/main/java/io/xpipe/core/store/DataStore.java @@ -1,7 +1,7 @@ package io.xpipe.core.store; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.xpipe.core.source.DataSourceDescriptor; +import io.xpipe.core.source.DataSource; import java.time.Instant; import java.util.Optional; @@ -11,7 +11,7 @@ import java.util.Optional; * It does not contain any information on what data is stored, * how the data is stored inside, or what part of the data store makes up the actual data source. * - * @see DataSourceDescriptor + * @see DataSource */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") public interface DataStore { diff --git a/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java b/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java index 227797706..e28aaa6bb 100644 --- a/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java +++ b/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java @@ -2,7 +2,7 @@ package io.xpipe.extension; import io.xpipe.core.config.ConfigOption; import io.xpipe.core.config.ConfigOptionSet; -import io.xpipe.core.source.DataSourceDescriptor; +import io.xpipe.core.source.DataSource; import io.xpipe.core.source.DataSourceType; import io.xpipe.core.store.DataStore; import javafx.beans.property.Property; @@ -14,7 +14,7 @@ import java.util.List; import java.util.Map; import java.util.function.Function; -public interface DataSourceProvider> { +public interface DataSourceProvider> { static enum GeneralType { FILE, @@ -33,7 +33,7 @@ public interface DataSourceProvider> { return false; } - default DataSourceDescriptor convert(T in, DataSourceType t) throws Exception { + default DataSource convert(T in, DataSourceType t) throws Exception { throw new ExtensionException(); } @@ -48,7 +48,7 @@ public interface DataSourceProvider> { return getId() + "." + key; } - default Region createConfigOptions(DataStore input, Property> source) { + default Region createConfigOptions(DataStore input, Property> source) { return null; } @@ -75,9 +75,9 @@ public interface DataSourceProvider> { Map> getFileExtensions(); } - interface ConfigProvider> { + interface ConfigProvider> { - static > ConfigProvider empty(List names, Function func) { + static > ConfigProvider empty(List names, Function func) { return new ConfigProvider<>() { @Override public ConfigOptionSet getConfig() { diff --git a/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java b/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java index bbdff7047..789e458d9 100644 --- a/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java +++ b/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java @@ -39,40 +39,40 @@ public class DataSourceProviders { @SuppressWarnings("unchecked") @SneakyThrows - public static StructureDataSourceDescriptor createLocalStructureDescriptor(DataStore store) { - return (StructureDataSourceDescriptor) + public static StructureDataSource createLocalStructureDescriptor(DataStore store) { + return (StructureDataSource) DataSourceProviders.byId("xpbs").getDescriptorClass() .getDeclaredConstructors()[0].newInstance(store); } @SuppressWarnings("unchecked") @SneakyThrows - public static RawDataSourceDescriptor createLocalRawDescriptor(DataStore store) { - return (RawDataSourceDescriptor) + public static RawDataSource createLocalRawDescriptor(DataStore store) { + return (RawDataSource) DataSourceProviders.byId("binary").getDescriptorClass() .getDeclaredConstructors()[0].newInstance(store); } @SuppressWarnings("unchecked") @SneakyThrows - public static RawDataSourceDescriptor createLocalCollectionDescriptor(DataStore store) { - return (RawDataSourceDescriptor) + public static RawDataSource createLocalCollectionDescriptor(DataStore store) { + return (RawDataSource) DataSourceProviders.byId("br").getDescriptorClass() .getDeclaredConstructors()[0].newInstance(store); } @SuppressWarnings("unchecked") @SneakyThrows - public static TextDataSourceDescriptor createLocalTextDescriptor(DataStore store) { - return (TextDataSourceDescriptor) + public static TextDataSource createLocalTextDescriptor(DataStore store) { + return (TextDataSource) DataSourceProviders.byId("text").getDescriptorClass() .getDeclaredConstructors()[0].newInstance(store); } @SuppressWarnings("unchecked") @SneakyThrows - public static TableDataSourceDescriptor createLocalTableDescriptor(DataStore store) { - return (TableDataSourceDescriptor) + public static TableDataSource createLocalTableDescriptor(DataStore store) { + return (TableDataSource) DataSourceProviders.byId("xpbt").getDescriptorClass() .getDeclaredConstructors()[0].newInstance(store); } @@ -89,7 +89,7 @@ public class DataSourceProviders { @SuppressWarnings("unchecked") - public static , T extends DataSourceProvider> T byDataSourceClass(Class c) { + public static , T extends DataSourceProvider> T byDataSourceClass(Class c) { if (ALL == null) { throw new IllegalStateException("Not initialized"); } diff --git a/extension/src/main/java/io/xpipe/extension/SimpleFileDataSourceProvider.java b/extension/src/main/java/io/xpipe/extension/SimpleFileDataSourceProvider.java index cb8b34e3d..793006ec5 100644 --- a/extension/src/main/java/io/xpipe/extension/SimpleFileDataSourceProvider.java +++ b/extension/src/main/java/io/xpipe/extension/SimpleFileDataSourceProvider.java @@ -1,6 +1,6 @@ package io.xpipe.extension; -import io.xpipe.core.source.DataSourceDescriptor; +import io.xpipe.core.source.DataSource; import io.xpipe.core.store.DataStore; import io.xpipe.core.store.FileDataStore; import io.xpipe.core.store.StreamDataStore; @@ -9,7 +9,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -public interface SimpleFileDataSourceProvider> extends DataSourceProvider { +public interface SimpleFileDataSourceProvider> extends DataSourceProvider { @Override default boolean prefersStore(DataStore store) { diff --git a/extension/src/main/java/io/xpipe/extension/UniformDataSourceProvider.java b/extension/src/main/java/io/xpipe/extension/UniformDataSourceProvider.java index d7d6780ae..f51e1e872 100644 --- a/extension/src/main/java/io/xpipe/extension/UniformDataSourceProvider.java +++ b/extension/src/main/java/io/xpipe/extension/UniformDataSourceProvider.java @@ -1,12 +1,12 @@ package io.xpipe.extension; -import io.xpipe.core.source.DataSourceDescriptor; +import io.xpipe.core.source.DataSource; import io.xpipe.core.store.DataStore; import java.lang.reflect.InvocationTargetException; import java.util.List; -public interface UniformDataSourceProvider> extends DataSourceProvider { +public interface UniformDataSourceProvider> extends DataSourceProvider { @Override default ConfigProvider getConfigProvider() { diff --git a/extension/src/main/java/io/xpipe/extension/comp/DynamicOptionsBuilder.java b/extension/src/main/java/io/xpipe/extension/comp/DynamicOptionsBuilder.java index b0bbadd01..3028806d3 100644 --- a/extension/src/main/java/io/xpipe/extension/comp/DynamicOptionsBuilder.java +++ b/extension/src/main/java/io/xpipe/extension/comp/DynamicOptionsBuilder.java @@ -1,6 +1,6 @@ package io.xpipe.extension.comp; -import io.xpipe.core.source.DataSourceDescriptor; +import io.xpipe.core.source.DataSource; import io.xpipe.fxcomps.Comp; import javafx.beans.Observable; import javafx.beans.binding.Bindings; @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; -public class DynamicOptionsBuilder> { +public class DynamicOptionsBuilder> { private final List entries = new ArrayList<>(); private final List> props = new ArrayList<>();