Package cdc.impex
Class ImpExFactory
- java.lang.Object
-
- cdc.impex.ImpExFactory
-
public class ImpExFactory extends Object
Factory ofImporters,ExportDrivers andTemplateGenerators.Note:At the moment, CSV, XLS, XSLX, XLSM and ODS workbooks are supported. In the future, some other formats (such as XML or JSON) may/will be supported.
- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description ImpExFactory(ImpExFactoryFeatures features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExportTo(File file)booleancanImportFrom(File file)ExportDrivercreateExportDriver(File file, cdc.issues.IssuesHandler<? super ExportIssue> issuesHandler)Creates an ExportDriver for a file.ExportercreateExporter(File file)ImportAnalyzercreateImportAnalyzer(File file)ImportercreateImporter(File file)Creates an Importer for a file.TemplateGeneratorcreateTemplateGenerator(File file)Creates a TemplateGenarator for a file.ImpExFactoryFeaturesgetFeatures()
-
-
-
Constructor Detail
-
ImpExFactory
public ImpExFactory(ImpExFactoryFeatures features)
-
-
Method Detail
-
getFeatures
public ImpExFactoryFeatures getFeatures()
-
canImportFrom
public boolean canImportFrom(File file)
- Parameters:
file- The file- Returns:
trueiffilecan be imported.
WARNING:fileextension is checked.
-
createImporter
public Importer createImporter(File file)
Creates an Importer for a file.- Parameters:
file- The file.- Returns:
- An Importer that can import from
fileor any compliant file. - Throws:
IllegalArgumentException- Whenfileisnullor extension is not recognized.
-
canExportTo
public boolean canExportTo(File file)
- Parameters:
file- The file- Returns:
trueif data cab be exported tofile.
WARNING:fileextension is checked.
-
createExportDriver
public ExportDriver createExportDriver(File file, cdc.issues.IssuesHandler<? super ExportIssue> issuesHandler)
Creates an ExportDriver for a file.- Parameters:
file- The file.issuesHandler- The issues handler.- Returns:
- An ExportDriver that can export to
fileor any compliant file. - Throws:
IllegalArgumentException- Whenfileisnullor extension is not recognized.
-
createTemplateGenerator
public TemplateGenerator createTemplateGenerator(File file)
Creates a TemplateGenarator for a file.- Parameters:
file- The file.- Returns:
- A TemplateGenrator that matches
file. It can be used with any compliant file. - Throws:
IllegalArgumentException- Whenfileisnullor extension is not recognized.
-
createImportAnalyzer
public ImportAnalyzer createImportAnalyzer(File file)
-
-