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>
public interface ImportHandler<DTO extends ImportedFileDTO,D extends ImportedFileData,IF extends ImportedFile,E extends SimpleEntity>Handler for imports
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description StringfieldName(ImportedField field)Returns the field display namevoidfinishImport(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 entityList<ImportedField>getFieldsInList(IF importedFile)Returns the fields which should be shown in the lines search list.Class<IF>getImportedFileClass()Returns the imported file classImportTypegetImportType()Returns the type of imports handled by this classSet<String>getMissingRequiredFields(IF importedFile, List<String> headers)Return the fields that are required and are not present in the given headers.ObjectinstantiateContext()Returns an import context that will be used in the validation and processing of each import line.static booleanisImported(EntityDTO dto)Returns whether the dto is being imported or notstatic voidmarkAsImported(EntityDTO dto)IFnewEntity(ImportedFileDataParams params)Instantiates a new imported file with defaultsIFnewImportedFile(DTO dto)Instantiates anImportedFilea new entity based on a dtovoidonImportError(ImportedLine importedLine, Throwable e)Updates the given line when an error has occurredEprocessImportedLine(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
-
isImported
static boolean isImported(EntityDTO dto)
Returns whether the dto is being imported or not
-
markAsImported
static void markAsImported(EntityDTO dto)
-
fieldName
String fieldName(ImportedField field)
Returns the field display name
-
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
-
getFieldsInList
List<ImportedField> getFieldsInList(IF importedFile)
Returns the fields which should be shown in the lines search list.
-
getImportType
ImportType getImportType()
Returns the type of imports handled by this class
-
getMissingRequiredFields
Set<String> getMissingRequiredFields(IF importedFile, List<String> headers)
Return the fields that are required and are not present in the given headers.
-
instantiateContext
Object instantiateContext()
Returns an import context that will be used in the validation and processing of each import line.
-
newEntity
IF newEntity(ImportedFileDataParams params)
Instantiates a new imported file with defaults
-
newImportedFile
IF newImportedFile(DTO dto)
Instantiates anImportedFilea new entity based on a dto
-
onImportError
void onImportError(ImportedLine importedLine, Throwable e)
Updates the given line when an error has occurred
-
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
-
-