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 createImportParameters
. An implementation of this interface should use parsed values from to validate user's input. Each instance ofAbstractExcelImportWorkbookDecorator
contains list ofExcelAttributeValidator
and appropriate validators are chosen based oncanHandle(ExcelAttribute, ImportParameters)
method. IfcanHandle(ExcelAttribute, ImportParameters)
returns true thenvalidate(ExcelAttribute, ImportParameters, Map)
method will be invoked.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHandle(T excelAttribute, ImportParameters importParameters)
Indicates whether validator is able to validate given cell value.ExcelValidationResult
validate(T excelAttribute, ImportParameters importParameters, java.util.Map<java.lang.String,java.lang.Object> context)
Validates given cell and returns validation result.
-
-
-
Method Detail
-
canHandle
boolean canHandle(@Nonnull T excelAttribute, @Nonnull ImportParameters importParameters)
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 java.util.Map<java.lang.String,java.lang.Object> context)
Validates given cell and returns validation result. If cell doesn't have validation issues thenExcelValidationResult.SUCCESS
should 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:
-
-