Class ExcelMandatoryClassificationFieldValidator
java.lang.Object
com.hybris.backoffice.excel.validators.classification.ExcelMandatoryClassificationFieldValidator
- All Implemented Interfaces:
ExcelAttributeValidator<ExcelClassificationAttribute>
public class ExcelMandatoryClassificationFieldValidator
extends Object
implements ExcelAttributeValidator<ExcelClassificationAttribute>
Default excel's classification validator for mandatory fields. The Validator is invoked only when
ExcelClassificationAttribute.isMandatory() returns true. If attribute is mandatory then the validator checks
whether ImportParameters.getCellValue() is not blank-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(ExcelClassificationAttribute excelAttribute, ImportParameters importParameters) Checks whetherExcelClassificationAttribute.isMandatory()returns true.voidsetCommonI18NService(CommonI18NService commonI18NService) validate(ExcelClassificationAttribute excelAttribute, ImportParameters importParameters, Map<String, Object> context) Checks whetherImportParameters.getCellValue()is not blank.
-
Constructor Details
-
ExcelMandatoryClassificationFieldValidator
public ExcelMandatoryClassificationFieldValidator()
-
-
Method Details
-
canHandle
public boolean canHandle(@Nonnull ExcelClassificationAttribute excelAttribute, @Nonnull ImportParameters importParameters) Checks whetherExcelClassificationAttribute.isMandatory()returns true.- Specified by:
canHandlein interfaceExcelAttributeValidator<ExcelClassificationAttribute>- Parameters:
excelAttribute-importParameters-- Returns:
- true when attribute is mandatory.
-
validate
public ExcelValidationResult validate(@Nonnull ExcelClassificationAttribute excelAttribute, @Nonnull ImportParameters importParameters, @Nonnull Map<String, Object> context) Checks whetherImportParameters.getCellValue()is not blank.- Specified by:
validatein interfaceExcelAttributeValidator<ExcelClassificationAttribute>- Parameters:
excelAttribute-importParameters-context- map which can be used as a cache. The map is shared between all request for given excel sheet.- Returns:
ExcelValidationResultwhich contains validation messages. If validator does not return any validation issues thenExcelValidationResult.SUCCESSwill be returned.
-
setCommonI18NService
-