Package cdc.impex.api
Class ImpExFactory
- java.lang.Object
-
- cdc.impex.api.ImpExFactory
-
public class ImpExFactory extends Object
Factory ofImporters,Exporters 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 ExportercreateExporter(File file, cdc.issues.api.IssuesHandler<ExportIssueType> issuesHandler)Creates an Exporter for a 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()
-
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.
-
createExporter
public Exporter createExporter(File file, cdc.issues.api.IssuesHandler<ExportIssueType> issuesHandler)
Creates an Exporter for a file.- Parameters:
file- The file.issuesHandler- The issues handler.- Returns:
- An Exporter 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.
-
-