Package cdc.impex.api

Class ImpExFactory


  • public class ImpExFactory
    extends Object
    Factory of Importers, Exporters 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
    • Method Detail

      • createImporter

        public Importer createImporter​(File file)
        Creates an Importer for a file.
        Parameters:
        file - The file.
        Returns:
        An Importer that can import from file or any compliant file.
        Throws:
        IllegalArgumentException - When file is null or 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 file or any compliant file.
        Throws:
        IllegalArgumentException - When file is null or 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 - When file is null or extension is not recognized.