Class ExcelMandatoryFieldValidator
java.lang.Object
com.hybris.backoffice.excel.validators.ExcelMandatoryFieldValidator
- All Implemented Interfaces:
ExcelValidator
Default excel validator which checks whether cell is not empty. The validator is invoked only for cells where
AttributeDescriptorModel.getOptional() returns false. If field is localized then validator checks whether
ImportParameters.isoCode is equals to CommonI18NService.getCurrentLanguage().-
Field Summary
FieldsFields inherited from interface com.hybris.backoffice.excel.validators.ExcelValidator
CTX_MEDIA_CONTENT_ENTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor) Indicates whether given validator can handle a cell based on attribute descriptor and import parameters.voidsetCommonI18NService(CommonI18NService commonI18NService) validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Validates given cell and returns validation result.
-
Field Details
-
VALIDATION_MANDATORY_FIELD_MESSAGE_KEY
- See Also:
-
-
Constructor Details
-
ExcelMandatoryFieldValidator
public ExcelMandatoryFieldValidator()
-
-
Method Details
-
validate
public ExcelValidationResult validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Description copied from interface:ExcelValidatorValidates given cell and returns validation result. If cell doesn't have validation issues thenExcelValidationResult.SUCCESSshould be returned.- Specified by:
validatein interfaceExcelValidatorcontext- - map which can be used as a cache. The map is shared between all request for given excel sheet.- Returns:
ExcelValidationResult
-
canHandle
public boolean canHandle(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor) Description copied from interface:ExcelValidatorIndicates whether given validator can handle a cell based on attribute descriptor and import parameters.- Specified by:
canHandlein interfaceExcelValidator- Returns:
- boolean whether validator can handle the cell.
-
getCommonI18NService
-
setCommonI18NService
-