Interface ExcelHeaderService
- All Known Implementing Classes:
DefaultExcelHeaderService
public interface ExcelHeaderService
Service responsible for writing and reading attributes related to header rows, e.g.
ExcelTemplateConstants.Header.DISPLAY_NAME,
ExcelTemplateConstants.Header.REFERENCE_PATTERN,
ExcelTemplateConstants.Header.DEFAULT_VALUE-
Method Summary
Modifier and TypeMethodDescriptiongetHeaderDisplayNames(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.default StringgetHeaderValueWithoutSpecialMarks(String headerValue) Removes special characters, defined byExcelTemplateConstants.SpecialMark, from given inputgetSelectedAttributesQualifiers(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 forinsertAttributeHeader(Sheet, ExcelAttribute, int)It is possible to inserts all values to the header at once instead of invokinginsertAttributeHeader(Sheet, ExcelAttribute, int)for every attribute separately
-
Method Details
-
getHeaders
Collection<SelectedAttribute> getHeaders(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.- Parameters:
metaInformationSheet-Sheetcontains metaInformation about attributes for each type sheetstypeSheet-Sheetcontains data for given sheet- Returns:
- collection of selected attributes
-
getHeaderDisplayNames
Returns list of attribute display names, that is: the contents of the display name row:ExcelTemplateConstants.Header.DISPLAY_NAME- Parameters:
sheet- TheSheetfrom which the display names should be taken- Returns:
- List of display names for each attribute in the sheet
-
getSelectedAttributesQualifiers
Collection<SelectedAttributeQualifier> getSelectedAttributesQualifiers(org.apache.poi.ss.usermodel.Sheet metaInformationSheet, org.apache.poi.ss.usermodel.Sheet typeSheet) Returns qualifiers of attributes which at selected in the typSheet- Parameters:
metaInformationSheet-Sheetcontains metaInformation about attributes for each type sheetstypeSheet-Sheetcontains data for given sheet- Returns:
- collection of selected attributes.
-
insertAttributeHeader
void insertAttributeHeader(org.apache.poi.ss.usermodel.Sheet sheet, ExcelAttribute excelAttribute, int columnIndex) Inserts value to the sheet's header- 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
void insertAttributesHeader(org.apache.poi.ss.usermodel.Sheet sheet, Collection<? extends ExcelAttribute> excelAttributes) A shortcut forinsertAttributeHeader(Sheet, ExcelAttribute, int)It is possible to inserts all values to the header at once instead of invokinginsertAttributeHeader(Sheet, ExcelAttribute, int)for every attribute separately- Parameters:
sheet- where the value will be insertedexcelAttributes- a collection of pojos which allows to retrieve value to insert
-
getHeaderValueWithoutSpecialMarks
Removes special characters, defined byExcelTemplateConstants.SpecialMark, from given input- Parameters:
headerValue- input- Returns:
- headerValue without special marks
-