java.lang.Object
org.tquadrat.bloodpressure.spi.DataImporterBase
- All Implemented Interfaces:
DataImporter
- Direct Known Subclasses:
BlutdruckdatenCSVImporter
@ClassVersion(sourceVersion="$Id: DataImporterBase.java 120 2022-02-10 18:58:05Z tquadrat $")
@API(status=STABLE,
since="0.0.1")
public abstract non-sealed class DataImporterBase
extends Object
implements DataImporter
The abstract base class for the data import components.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: DataImporterBase.java 120 2022-02-10 18:58:05Z tquadrat $
- Since:
- 0.0.1
- UML Diagram
-
UML Diagram for "org.tquadrat.bloodpressure.spi.DataImporterBase"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tquadrat.bloodpressure.DataImporter
DataImporter.Key -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe identifier for the data origin.private final InputFormatThe input format that is handled by this implementation ofDataImporter.private static final Map<DataImporter.Key,DataImporter> The registry for the data importer. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDataImporterBase(InputFormat inputFormat, String dataOrigin) Creates a new instance ofDataImporterBase. -
Method Summary
Modifier and TypeMethodDescriptionfinal DataImporter.KeygetKey()Returns the registry key for this data importer.abstract Collection<DataRecord>Parses the data on the given source location and returns a collection ofDataRecordinstance.static final voidregisterImporter(DataImporter importer) Registers aDataImporterinstance.static final Optional<DataImporter>retrieveDataImporter(InputFormat inputFormat, String dataOrigin) Returns the data importer that is identified by the given input format and data origin.
-
Field Details
-
m_DataOrigin
The identifier for the data origin. -
m_InputFormat
The input format that is handled by this implementation ofDataImporter. -
m_Registry
The registry for the data importer.
-
-
Constructor Details
-
DataImporterBase
Creates a new instance ofDataImporterBase.- Parameters:
inputFormat- The input format that is handled by this implementation ofDataImporter.dataOrigin- The identifier for the data origin.
-
-
Method Details
-
getKey
Returns the registry key for this data importer.- Specified by:
getKeyin interfaceDataImporter- Returns:
- The key.
-
parse
public abstract Collection<DataRecord> parse(URI source, ZoneId timezone, Charset encoding) throws IOException Parses the data on the given source location and returns a collection ofDataRecordinstance.- Specified by:
parsein interfaceDataImporter- Parameters:
source- The location for the source data.timezone- The time zone for the timestamp on the source data.encoding- The encoding of the source data.- Returns:
- The data records.
- Throws:
IOException- Something went wrong while pulling the data from the source.
-
registerImporter
Registers aDataImporterinstance.- Parameters:
importer- The instance to register.
-
retrieveDataImporter
public static final Optional<DataImporter> retrieveDataImporter(InputFormat inputFormat, String dataOrigin) Returns the data importer that is identified by the given input format and data origin.- Parameters:
inputFormat- The input format.dataOrigin- The identifier for the data origin.- Returns:
- An instance of
Optionalthat holds the retrieved data importer.
-
