Package cdc.impex.imports
Interface Importer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface implemented by classes that can analyze a file to prepare data for import.
An importer analyzes input files, detects issues in them, find the appropriate template, and calls the passed SheetImporter.
- Author:
- Damien Carbonne
-
Method Summary
Modifier and TypeMethodDescriptionvoidimportData(File file, Set<SheetTemplate> templates, WorkbookImporter workbookImporter, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler, cdc.util.events.ProgressController controller) Invoked to analyze a file that contains data to import.static voidimportData(File file, Set<String> templateNames, ImpExCatalog catalog, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler, cdc.util.events.ProgressController controller, ImpExFactoryFeatures features)
-
Method Details
-
importData
void importData(File file, Set<SheetTemplate> templates, WorkbookImporter workbookImporter, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler, cdc.util.events.ProgressController controller) throws IOException Invoked to analyze a file that contains data to import.- Parameters:
file- The file to import.templates- The templates for which matching sheets must be loaded.
Non-matching sheets are ignored.workbookImporter- The workbook importer .
Note: one should useWorkbookImporter.fromDelegates(WorkbookImporter, java.util.function.Function)orWorkbookImporter.fromDelegates(WorkbookImporter, java.util.Map)to compose individual SheetImporters into one WorkbookImporter.issuesHandler- The issues handler.controller- The progress controller.- Throws:
IllegalArgumentException- Whenfile,templates,sheetImporterorissuesHandlerisnull.IOException- When an IO error occurs.
-
importData
static void importData(File file, Set<String> templateNames, ImpExCatalog catalog, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler, cdc.util.events.ProgressController controller, ImpExFactoryFeatures features) throws IOException - Throws:
IOException
-