Interface ExcelAttributeValidator<T extends ExcelAttribute>
- Type Parameters:
T- subclass ofExcelAttribute
- All Known Implementing Classes:
AbstractSingleClassificationFieldValidator,ExcelBooleanClassificationFieldValidator,ExcelClassificationGenericReferenceValidator,ExcelDateClassificationFieldValidator,ExcelDefaultValuesClassificationFieldValidator,ExcelEnumClassificationValidator,ExcelMandatoryClassificationFieldValidator,ExcelMediaClassificationValidator,ExcelMultivalueClassificationFieldValidator,ExcelNumberClassificationFieldValidator,ExcelRangeClassificationFieldValidator,ExcelUnitClassificationFieldValidator
public interface ExcelAttributeValidator<T extends ExcelAttribute>
Excel validator interface used by excel attribute's translator. This validator should be used for validating an
excel's cell. For each excel's cell, excel mechanism parses default values and cell values in order to create
ImportParameters. An implementation of this interface should use parsed values from to validate
user's input. Each instance of AbstractExcelImportWorkbookDecorator contains list of
ExcelAttributeValidator and appropriate validators are chosen based on
canHandle(ExcelAttribute, ImportParameters) method. If
canHandle(ExcelAttribute, ImportParameters) returns true then
validate(ExcelAttribute, ImportParameters, Map) method will be invoked.-
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(T excelAttribute, ImportParameters importParameters) Indicates whether validator is able to validate given cell value.Validates given cell and returns validation result.
-
Method Details
-
canHandle
Indicates whether validator is able to validate given cell value.- Parameters:
excelAttribute-importParameters-- Returns:
- boolean whether validator can validate the cell
-
validate
ExcelValidationResult validate(@Nonnull T excelAttribute, @Nonnull ImportParameters importParameters, @Nonnull Map<String, Object> context) Validates given cell and returns validation result. If cell doesn't have validation issues thenExcelValidationResult.SUCCESSshould be returned.- Parameters:
excelAttribute-importParameters-context- map which can be used as a cache. The map is shared between all request for given excel sheet.- Returns:
-