Package cdc.impex.api

Interface ImportHandler

    • Method Detail

      • beginImport

        void beginImport​(String systemId,
                         cdc.issues.api.IssuesHandler<ImportIssueType> issuesHandler)
        Invoked to notify the beginning of import.
        Parameters:
        systemId - The system if of the imported data.
        issuesHandler - The issues handler that should be used by the application to generate new issues.
      • beginSheetImport

        void beginSheetImport​(String systemId,
                              String sheetName,
                              SheetTemplate template,
                              cdc.issues.api.IssuesHandler<ImportIssueType> issuesHandler)
        Invoked to notify the beginning of the import of a sheet.
        Parameters:
        systemId - The system if of the imported data.
        sheetName - The sheet name.
        template - The sheet template associated to this import.
        issuesHandler - The issues handler that should be used by the application to generate new issues.
      • importRow

        void importRow​(ImportRow row,
                       cdc.issues.api.IssuesHandler<ImportIssueType> issuesHandler)
        Invoked to notify the import a row.
        Parameters:
        row - The imported row.
        issuesHandler - The issues handler that should be used by the application to generate new issues.
      • endSheetImport

        void endSheetImport​(String systemId,
                            String sheetName,
                            SheetTemplate template,
                            cdc.issues.api.IssuesHandler<ImportIssueType> issuesHandler)
        Invoked to notify the end of the import of a sheet.
        Parameters:
        systemId - The system if of the imported data.
        sheetName - The sheet name.
        template - The sheet template associated to this import.
        issuesHandler - The issues handler that should be used by the application to generate new issues.
      • endImport

        void endImport​(String systemId,
                       cdc.issues.api.IssuesHandler<ImportIssueType> issuesHandler)
        Invoked to notify the end of import.
        Parameters:
        systemId - The system if of the imported data.
        issuesHandler - The issues handler that should be used by the application to generate new issues.
      • fromDelegates

        static ImportHandler fromDelegates​(ImportHandler def,
                                           Function<String,​ImportHandler> function)
        Creates a delegating handler.

        When the import of a sheet starts, an appropriate handler is selected, if possible, among delegates. If no appropriate handler is found, a default one is used. The default will usually ignore things.

        Parameters:
        def - The default import handler.
        It can be DefaultImportHandler.QUIET, DefaultImportHandler.VERBOSE, or any other valid ImportHandler.
        function - The function that maps template names to the associated importers.
        Returns:
        A new ImportHandler that delegates import if possible, or use the default handler otherwise.