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 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 - Sheet contains metaInformation about attributes for each type sheets
      typeSheet - Sheet contains data for given sheet
      Returns:
      collection of selected attributes
    • getHeaderDisplayNames

      Collection<String> 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_NAME
      Parameters:
      sheet - The Sheet from 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 - Sheet contains metaInformation about attributes for each type sheets
      typeSheet - Sheet contains 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 inserted
      excelAttribute - a pojo which allows to retrieve value to insert
      columnIndex - index of a column for inserted value
    • insertAttributesHeader

      void insertAttributesHeader(org.apache.poi.ss.usermodel.Sheet sheet, Collection<? extends ExcelAttribute> excelAttributes)
      A shortcut for insertAttributeHeader(Sheet, ExcelAttribute, int) It is possible to inserts all values to the header at once instead of invoking insertAttributeHeader(Sheet, ExcelAttribute, int) for every attribute separately
      Parameters:
      sheet - where the value will be inserted
      excelAttributes - a collection of pojos which allows to retrieve value to insert
    • getHeaderValueWithoutSpecialMarks

      default String getHeaderValueWithoutSpecialMarks(@Nonnull String headerValue)
      Removes special characters, defined by ExcelTemplateConstants.SpecialMark, from given input
      Parameters:
      headerValue - input
      Returns:
      headerValue without special marks