Package org.cyclos.impl.system
Interface ImportHandler<DTO extends ImportedFileDTO,D extends ImportedFileData,IF extends ImportedFile,E extends SimpleEntity>
-
- All Known Subinterfaces:
ImportWithImageHandler<DTO,D,IF,E>
- All Known Implementing Classes:
AdImportHandlerImpl,BankingImportHandlerImpl,BaseImportHandlerImpl,BaseWithFieldsImportHandlerImpl,GeneralReferenceImportHandlerImpl,PaymentImportHandlerImpl,RecordImportHandlerImpl,TokenImportHandlerImpl,TransferImportHandlerImpl,UserImportHandlerImpl,UserPaymentsImportHandlerImpl
public interface ImportHandler<DTO extends ImportedFileDTO,D extends ImportedFileData,IF extends ImportedFile,E extends SimpleEntity>Handler for imports
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringfieldName(ImportedLine line, String field, String id)Returns the field display name for the given field and idvoidfinishImport(IF importedFile)Executes some processing when import has finishedPredicate<String>getAllowedImportFieldsPredicate(IF importedFile)Returns a predicate that evaluates true for a field allowed to be importedDgetData(IF importedFile)Returns the data associated to an importClass<E>getEntityClass()Returns the class of the imported entityClass<IF>getImportedFileClass()Returns the imported file classImportTypegetImportType()Returns the type of imports handled by this classList<String>getKeywordFields()Returns a list of field names that can be used to search for imported linesSet<String>getMissingRequiredFields(IF importedFile, List<String> headers)Return the fields that are required and are not present in the given headers.List<ImportField>getSearchImportedLineFields()Returns the list of fields that will be used to show the information of import lines.ObjectinstantiateContext()Returns an import context that will be used in the validation and processing of each import line.IFnewImportedFile(DTO dto)Instantiates anImportedFilea new entity based on a dtoEprocessImportedLine(ImportedLine importedLine, Object context)Imports an entity with the information in the imported line and returns the imported entity.ValidatorresolveValidator(DTO dto)Returns a new validator for the import.voidvalidateImportedLine(ImportedLine importedLine, Object context)Validates the imported line
-
-
-
Method Detail
-
fieldName
String fieldName(ImportedLine line, String field, String id)
Returns the field display name for the given field and id
-
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
-
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 anImportedFilea 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.
-
validateImportedLine
void validateImportedLine(ImportedLine importedLine, Object context) throws ValidationException
Validates the imported line- Throws:
ValidationException
-
-