Package cdc.impex
Class ImpExFactory
java.lang.Object
cdc.impex.ImpExFactory
Factory of
Importers, StreamExporters and TemplateGenerators.
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExportTo(File file) booleancanImportFrom(File file) createActiveExporter(ImpExFormat format) Creates an {link ActiveExporter} implementation that is compliant with a format.createActiveExporter(File file) Creates an {link ActiveExporter} implementation that is compliant with the format of a file.createExporter(ImpExFormat format) Creates an {link Exporter} implementation that is compliant with a format.createExporter(File file) Creates an {link Exporter} implementation that is compliant with the format of a file.createImportAnalyzer(File file) createImporter(File file) Creates an Importer for a file.createStreamExporter(ImpExFormat format, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Creates aStreamExporterfor a format.createStreamExporter(File file, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Creates aStreamExportercompliant with a file extension.createTemplateGenerator(File file) Creates a TemplateGenarator for a file.
-
Constructor Details
-
ImpExFactory
-
-
Method Details
-
getFeatures
-
canImportFrom
- Parameters:
file- The file- Returns:
trueiffilecan be imported.
WARNING:fileextension is checked.
-
createImporter
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
- Parameters:
file- The file- Returns:
trueif data cab be exported tofile.
WARNING:fileextension is checked.
-
createStreamExporter
public StreamExporter createStreamExporter(ImpExFormat format, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Creates aStreamExporterfor a format.- Parameters:
format- The format.issuesHandler- The issues handler.- Returns:
- A
StreamExportercompliant withformat. - Throws:
IllegalArgumentException- WhenformatorissuesHandlerisnull.
-
createStreamExporter
public StreamExporter createStreamExporter(File file, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Creates aStreamExportercompliant with a file extension.- Parameters:
file- The file.issuesHandler- The issues handler.- Returns:
- A
StreamExporterthat can export tofileor any other compliant file. - Throws:
IllegalArgumentException- WhenfileorissuesHandlerisnull, or file extension is not recognized.
-
createExporter
Creates an {link Exporter} implementation that is compliant with the format of a file.- Parameters:
file- The file.- Returns:
- An {link Exporter} implementation compliant with format of
file. - Throws:
IllegalArgumentException- Whenfileisnullor its format is not supported.
-
createExporter
Creates an {link Exporter} implementation that is compliant with a format.- Parameters:
format- The format.- Returns:
- An {link Exporter} implementation compliant with
format. - Throws:
IllegalArgumentException- Whenformatisnull.
-
createActiveExporter
Creates an {link ActiveExporter} implementation that is compliant with the format of a file.- Parameters:
file- The file.- Returns:
- An {link ActiveExporter} implementation compliant with format of
file. - Throws:
IllegalArgumentException- Whenfileisnullor its format is not supported.
-
createActiveExporter
Creates an {link ActiveExporter} implementation that is compliant with a format.- Parameters:
format- The format.- Returns:
- An {link ActiveExporter} implementation compliant with
format. - Throws:
IllegalArgumentException- Whenformatisnull.
-
createTemplateGenerator
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
-