Interface ImportHandler<DTO extends ImportedFileDTO,​D extends ImportedFileData,​IF extends ImportedFile,​E extends SimpleEntity>

    • Method Detail

      • finishImport

        void finishImport​(IF importedFile)
        Executes some processing when import has finished
      • getAllowedImportFieldsPredicate

        Predicate<String> getAllowedImportFieldsPredicate​(IF importedFile)
        Returns a predicate that evaluates true for a field allowed to be imported
      • getData

        D getData​(IF importedFile)
        Returns the data associated to an import
      • getEntityClass

        Class<E> getEntityClass()
        Returns the class of the imported entity
      • getImportedFileClass

        Class<IF> getImportedFileClass()
        Returns the imported file class
      • getImportType

        ImportType getImportType()
        Returns the type of imports handled by this class
      • getKeywordFields

        List<String> getKeywordFields()
        Returns a list of field names that can be used to search for imported lines
      • getMissingRequiredFields

        Set<String> getMissingRequiredFields​(IF importedFile,
                                             List<String> headers)
        Return the fields that are required and are not present in the given headers.
      • getSearchImportedLineFields

        List<ImportField> getSearchImportedLineFields()
        Returns the list of fields that will be used to show the information of import lines.
      • instantiateContext

        Object instantiateContext()
        Returns an import context that will be used in the validation and processing of each import line.
      • newImportedFile

        IF newImportedFile​(DTO dto)
        Instantiates an ImportedFile a new entity based on a dto
      • processImportedLine

        E processImportedLine​(ImportedLine importedLine,
                              Object context)
        Imports an entity with the information in the imported line and returns the imported entity.
      • resolveValidator

        Validator resolveValidator​(DTO dto)
        Returns a new validator for the import.