Package cdc.impex.api

Interface ImportHandler

    • Method Detail

      • beginSheetImport

        void beginSheetImport​(String systemId,
                              String sheetName,
                              SheetTemplate template)
        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.
      • importData

        void importData​(ImportRow data)
        Invoked to notify the import a a data row.
        Parameters:
        data - The imported data row.
      • endSheetImport

        void endSheetImport​(String systemId,
                            String sheetName,
                            SheetTemplate template)
        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.
      • 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.
        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.
      • fromDelegates

        static ImportHandler fromDelegates​(ImportHandler def,
                                           Map<String,​ImportHandler> map)
        Creates a delegating handler.
        Parameters:
        def - The default import handler.
        map - The map from template names to the associated importers.
        Returns:
        A new ImportHandler that delegates import if possible, or use the default handler otherwise.