Class WorkbookMandatoryColumnsValidator
- java.lang.Object
-
- com.hybris.backoffice.excel.validators.WorkbookMandatoryColumnsValidator
-
- All Implemented Interfaces:
WorkbookValidator
public class WorkbookMandatoryColumnsValidator extends java.lang.Object implements WorkbookValidator
Default excel validator which checks whether all mandatory columns are selected for each excel sheet. If mandatory column is localized then column for current language is required.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVALIDATION_MESSAGE_DESCRIPTIONstatic java.lang.StringVALIDATION_MESSAGE_HEADER
-
Constructor Summary
Constructors Constructor Description WorkbookMandatoryColumnsValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Set<AttributeDescriptorModel>findAllMandatoryFields(java.lang.String typeCode)protected java.lang.StringgetAttributeDisplayedName(AttributeDescriptorModel attributeDescriptor)CommonI18NServicegetCommonI18NService()DisplayNameAttributeNameFormattergetDisplayNameAttributeNameFormatter()ExcelSheetServicegetExcelSheetService()ExcelTemplateServicegetExcelTemplateService()Deprecated, for removal: This API element is subject to removal in a future version.since 1808.ExcelWorkbookServicegetExcelWorkbookService()ExcelMapper<java.lang.String,AttributeDescriptorModel>getMapper()TypeServicegetTypeService()Deprecated, for removal: This API element is subject to removal in a future version.since 1808.protected booleanhasNotDefaultValue(AttributeDescriptorModel attributeDescriptorModel)Deprecated, for removal: This API element is subject to removal in a future version.since 1808.protected ExcelAttributeDescriptorAttributeprepareExcelAttribute(AttributeDescriptorModel attributeDescriptor, java.lang.String isoCode)protected SelectedAttributeprepareSelectedAttribute(AttributeDescriptorModel attributeDescriptor)voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetDisplayNameAttributeNameFormatter(DisplayNameAttributeNameFormatter displayNameAttributeNameFormatter)voidsetExcelSheetService(ExcelSheetService excelSheetService)voidsetExcelTemplateService(ExcelTemplateService excelTemplateService)Deprecated, for removal: This API element is subject to removal in a future version.since 1808.voidsetExcelWorkbookService(ExcelWorkbookService excelWorkbookService)voidsetMapper(ExcelMapper<java.lang.String,AttributeDescriptorModel> mapper)voidsetTypeService(TypeService typeService)Deprecated, for removal: This API element is subject to removal in a future version.since 1808.java.util.List<ExcelValidationResult>validate(org.apache.poi.ss.usermodel.Workbook workbook)Validates workbook.protected java.util.Optional<ExcelValidationResult>validateSheet(org.apache.poi.ss.usermodel.Sheet typeSystemSheet, org.apache.poi.ss.usermodel.Sheet sheet)
-
-
-
Field Detail
-
VALIDATION_MESSAGE_HEADER
public static final java.lang.String VALIDATION_MESSAGE_HEADER
- See Also:
- Constant Field Values
-
VALIDATION_MESSAGE_DESCRIPTION
public static final java.lang.String VALIDATION_MESSAGE_DESCRIPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public java.util.List<ExcelValidationResult> validate(org.apache.poi.ss.usermodel.Workbook workbook)
Description copied from interface:WorkbookValidatorValidates workbook. If workbook doesn't have validation issues then empty list should be returned.- Specified by:
validatein interfaceWorkbookValidator- Returns:
- list of validation results. If workbook doesn't have validation issues then empty list should be returned.
-
validateSheet
protected java.util.Optional<ExcelValidationResult> validateSheet(org.apache.poi.ss.usermodel.Sheet typeSystemSheet, org.apache.poi.ss.usermodel.Sheet sheet)
-
prepareExcelAttribute
protected ExcelAttributeDescriptorAttribute prepareExcelAttribute(AttributeDescriptorModel attributeDescriptor, java.lang.String isoCode)
-
prepareSelectedAttribute
protected SelectedAttribute prepareSelectedAttribute(AttributeDescriptorModel attributeDescriptor)
-
getAttributeDisplayedName
protected java.lang.String getAttributeDisplayedName(AttributeDescriptorModel attributeDescriptor)
-
findAllMandatoryFields
public java.util.Set<AttributeDescriptorModel> findAllMandatoryFields(java.lang.String typeCode)
-
hasNotDefaultValue
@Deprecated(since="1808", forRemoval=true) protected boolean hasNotDefaultValue(AttributeDescriptorModel attributeDescriptorModel)Deprecated, for removal: This API element is subject to removal in a future version.since 1808. UseDefaultValueCheckingFilterinstead
-
getTypeService
@Deprecated(since="1808", forRemoval=true) public TypeService getTypeService()Deprecated, for removal: This API element is subject to removal in a future version.since 1808.
-
setTypeService
@Deprecated(since="1808", forRemoval=true) public void setTypeService(TypeService typeService)Deprecated, for removal: This API element is subject to removal in a future version.since 1808.
-
getCommonI18NService
public CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getExcelTemplateService
@Deprecated(since="1808", forRemoval=true) public ExcelTemplateService getExcelTemplateService()Deprecated, for removal: This API element is subject to removal in a future version.since 1808.
-
setExcelTemplateService
@Deprecated(since="1808", forRemoval=true) public void setExcelTemplateService(ExcelTemplateService excelTemplateService)Deprecated, for removal: This API element is subject to removal in a future version.since 1808.
-
getExcelWorkbookService
public ExcelWorkbookService getExcelWorkbookService()
-
setExcelWorkbookService
public void setExcelWorkbookService(ExcelWorkbookService excelWorkbookService)
-
getExcelSheetService
public ExcelSheetService getExcelSheetService()
-
setExcelSheetService
public void setExcelSheetService(ExcelSheetService excelSheetService)
-
getDisplayNameAttributeNameFormatter
public DisplayNameAttributeNameFormatter getDisplayNameAttributeNameFormatter()
-
setDisplayNameAttributeNameFormatter
public void setDisplayNameAttributeNameFormatter(DisplayNameAttributeNameFormatter displayNameAttributeNameFormatter)
-
getMapper
public ExcelMapper<java.lang.String,AttributeDescriptorModel> getMapper()
-
setMapper
public void setMapper(ExcelMapper<java.lang.String,AttributeDescriptorModel> mapper)
-
-