Class DefaultExcelHeaderService
java.lang.Object
com.hybris.backoffice.excel.template.header.DefaultExcelHeaderService
- All Implemented Interfaces:
ExcelHeaderService
Default implementation of
ExcelHeaderService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<org.apache.poi.ss.usermodel.Row>findTypeSystemRowForGivenHeader(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, String typeCode, String header) getHeaderDisplayNames(org.apache.poi.ss.usermodel.Sheet sheet) Returns list of attribute display names, that is: the contents of the display name row:ExcelTemplateConstants.Header.DISPLAY_NAMEgetHeaders(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, org.apache.poi.ss.usermodel.Sheet typeSheet) Returns list of selected attributes for given sheet, based on metainformation from type system sheet.getSelectedAttributesQualifiers(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, org.apache.poi.ss.usermodel.Sheet typeSheet) Returns qualifiers of attributes which at selected in the typSheetvoidinsertAttributeHeader(org.apache.poi.ss.usermodel.Sheet sheet, ExcelAttribute excelAttribute, int columnIndex) Inserts value to the sheet's headervoidinsertAttributesHeader(org.apache.poi.ss.usermodel.Sheet sheet, Collection<? extends ExcelAttribute> excelAttributes) A shortcut forExcelHeaderService.insertAttributeHeader(Sheet, ExcelAttribute, int)It is possible to inserts all values to the header at once instead of invokingExcelHeaderService.insertAttributeHeader(Sheet, ExcelAttribute, int)for every attribute separatelyprotected AttributeDescriptorModelloadAttributeDescriptor(org.apache.poi.ss.usermodel.Row row, String typeCode) protected StringloadIsoCode(org.apache.poi.ss.usermodel.Row row, String header) voidsetAttributeNameFormatter(AttributeNameFormatter<ExcelAttributeDescriptorAttribute> attributeNameFormatter) voidsetCollectionFormatter(CollectionFormatter collectionFormatter) voidsetDefaultValueIndex(ExcelTemplateConstants.Header defaultValueIndex) voidsetExcelCellService(ExcelCellService excelCellService) voidsetExcelSheetService(ExcelSheetService excelSheetService) voidsetExcelTranslatorRegistry(ExcelTranslatorRegistry excelTranslatorRegistry) voidsetHeaderRowIndex(ExcelTemplateConstants.Header headerRowIndex) voidsetReferencePatternRowIndex(ExcelTemplateConstants.Header referencePatternRowIndex) voidsetTypeService(TypeService typeService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hybris.backoffice.excel.template.header.ExcelHeaderService
getHeaderValueWithoutSpecialMarks
-
Constructor Details
-
DefaultExcelHeaderService
public DefaultExcelHeaderService()
-
-
Method Details
-
getHeaders
public Collection<SelectedAttribute> getHeaders(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, org.apache.poi.ss.usermodel.Sheet typeSheet) Description copied from interface:ExcelHeaderServiceReturns list of selected attributes for given sheet, based on metainformation from type system sheet.- Specified by:
getHeadersin interfaceExcelHeaderService- Parameters:
metaInformationSheet-Sheetcontains metaInformation about attributes for each type sheetstypeSheet-Sheetcontains data for given sheet- Returns:
- collection of selected attributes
-
getHeaderDisplayNames
Description copied from interface:ExcelHeaderServiceReturns list of attribute display names, that is: the contents of the display name row:ExcelTemplateConstants.Header.DISPLAY_NAME- Specified by:
getHeaderDisplayNamesin interfaceExcelHeaderService- Parameters:
sheet- TheSheetfrom which the display names should be taken- Returns:
- List of display names for each attribute in the sheet
-
getSelectedAttributesQualifiers
public Collection<SelectedAttributeQualifier> getSelectedAttributesQualifiers(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, org.apache.poi.ss.usermodel.Sheet typeSheet) Description copied from interface:ExcelHeaderServiceReturns qualifiers of attributes which at selected in the typSheet- Specified by:
getSelectedAttributesQualifiersin interfaceExcelHeaderService- Parameters:
metaInformationSheet-Sheetcontains metaInformation about attributes for each type sheetstypeSheet-Sheetcontains data for given sheet- Returns:
- collection of selected attributes.
-
insertAttributeHeader
public void insertAttributeHeader(org.apache.poi.ss.usermodel.Sheet sheet, ExcelAttribute excelAttribute, int columnIndex) Description copied from interface:ExcelHeaderServiceInserts value to the sheet's header- Specified by:
insertAttributeHeaderin interfaceExcelHeaderService- Parameters:
sheet- where the value will be insertedexcelAttribute- a pojo which allows to retrieve value to insertcolumnIndex- index of a column for inserted value
-
insertAttributesHeader
public void insertAttributesHeader(org.apache.poi.ss.usermodel.Sheet sheet, Collection<? extends ExcelAttribute> excelAttributes) Description copied from interface:ExcelHeaderServiceA shortcut forExcelHeaderService.insertAttributeHeader(Sheet, ExcelAttribute, int)It is possible to inserts all values to the header at once instead of invokingExcelHeaderService.insertAttributeHeader(Sheet, ExcelAttribute, int)for every attribute separately- Specified by:
insertAttributesHeaderin interfaceExcelHeaderService- Parameters:
sheet- where the value will be insertedexcelAttributes- a collection of pojos which allows to retrieve value to insert
-
findTypeSystemRowForGivenHeader
-
loadIsoCode
-
loadAttributeDescriptor
protected AttributeDescriptorModel loadAttributeDescriptor(org.apache.poi.ss.usermodel.Row row, String typeCode) -
setAttributeNameFormatter
public void setAttributeNameFormatter(AttributeNameFormatter<ExcelAttributeDescriptorAttribute> attributeNameFormatter) -
setTypeService
-
setCollectionFormatter
-
setExcelSheetService
-
setExcelCellService
-
setExcelTranslatorRegistry
-
setHeaderRowIndex
-
setReferencePatternRowIndex
-
setDefaultValueIndex
-