Class DefaultExcelSheetService

    • Constructor Detail

      • DefaultExcelSheetService

        public DefaultExcelSheetService()
    • Method Detail

      • getSheetsNames

        public java.util.Collection<java.lang.String> getSheetsNames​(@WillNotClose
                                                                     org.apache.poi.ss.usermodel.Workbook workbook)
        Description copied from interface: ExcelSheetService
        Returns all sheets names except utility sheets.
        Specified by:
        getSheetsNames in interface ExcelSheetService
        Parameters:
        workbook - Workbook object which represents excel file
        Returns:
        collection of sheets names
      • getSheets

        public java.util.Collection<org.apache.poi.ss.usermodel.Sheet> getSheets​(@WillNotClose
                                                                                 org.apache.poi.ss.usermodel.Workbook workbook)
        Description copied from interface: ExcelSheetService
        Returns all sheets except utility sheets.
        Specified by:
        getSheets in interface ExcelSheetService
        Parameters:
        workbook - Workbook object which represents excel file
        Returns:
        collection of sheets
      • createOrGetTypeSheet

        public org.apache.poi.ss.usermodel.Sheet createOrGetTypeSheet​(@WillNotClose
                                                                      org.apache.poi.ss.usermodel.Workbook workbook,
                                                                      @Nonnull
                                                                      java.lang.String typeCode)
        Description copied from interface: ExcelSheetService
        Creates a new type sheet in given workbook. If a sheet with given typeCode already exists, it is returned without creating an extra one.
        Specified by:
        createOrGetTypeSheet in interface ExcelSheetService
        Parameters:
        workbook - workbook which will be extended by a new sheet
        typeCode - a new sheet name
        Returns:
        newly created of already existed Sheet.
      • createTypeSheet

        public org.apache.poi.ss.usermodel.Sheet createTypeSheet​(@WillNotClose
                                                                 org.apache.poi.ss.usermodel.Workbook workbook,
                                                                 @Nonnull
                                                                 java.lang.String sheetName)
        Description copied from interface: ExcelSheetService
        Creates a new sheet and adds it to given workbook.
        Specified by:
        createTypeSheet in interface ExcelSheetService
        Parameters:
        workbook - workbook which will be extended by a new sheet
        sheetName - a new sheet name
        Returns:
        newly created Sheet.
      • createOrGetUtilitySheet

        public org.apache.poi.ss.usermodel.Sheet createOrGetUtilitySheet​(@WillNotClose
                                                                         org.apache.poi.ss.usermodel.Workbook workbook,
                                                                         @Nonnull
                                                                         java.lang.String sheetName)
        Description copied from interface: ExcelSheetService
        Creates a new utility sheet in given workbook. If a sheet with given name already exists, it is returned without creating an extra one.
        Specified by:
        createOrGetUtilitySheet in interface ExcelSheetService
        Parameters:
        workbook - workbook which will be extended by a new sheet
        sheetName - a new sheet name.
        Returns:
        newly created or already existed Sheet.
      • findColumnIndex

        public int findColumnIndex​(org.apache.poi.ss.usermodel.Sheet typeSystemSheet,
                                   @Nonnull
                                   org.apache.poi.ss.usermodel.Sheet sheet,
                                   ExcelAttribute excelAttribute)
        Description copied from interface: ExcelSheetService
        Finds column index based on selected attribute. If column doesn't exist then -1 will be returned.
        Specified by:
        findColumnIndex in interface ExcelSheetService
        Parameters:
        typeSystemSheet - sheet which contains information about type system
        sheet - sheet for current type
        excelAttribute - attribute for which column index should be found
        Returns:
        column index for given selected attribute. If column doesn't exist then -1 will be returned.
      • findTypeCodeForSheetName

        public java.lang.String findTypeCodeForSheetName​(@WillNotClose
                                                         org.apache.poi.ss.usermodel.Workbook workbook,
                                                         java.lang.String sheetName)
        Description copied from interface: ExcelSheetService
        Finds type code for given sheet name.
        Specified by:
        findTypeCodeForSheetName in interface ExcelSheetService
        Parameters:
        workbook - workbook
        sheetName - sheet name
        Returns:
        found type code.
      • findSheetNameForTypeCode

        public java.lang.String findSheetNameForTypeCode​(@WillNotClose
                                                         org.apache.poi.ss.usermodel.Workbook workbook,
                                                         java.lang.String typeCode)
        Description copied from interface: ExcelSheetService
        Finds sheet name for given type code.
        Specified by:
        findSheetNameForTypeCode in interface ExcelSheetService
        Parameters:
        workbook - workbook
        typeCode - type code
        Returns:
        found type code.
      • findAttributeDisplayNameInTypeSystemSheet

        protected java.lang.String findAttributeDisplayNameInTypeSystemSheet​(org.apache.poi.ss.usermodel.Sheet typeSystemSheet,
                                                                             ExcelAttribute excelAttribute)
      • setCollectionFormatter

        public void setCollectionFormatter​(CollectionFormatter collectionFormatter)
      • setExcelCellService

        public void setExcelCellService​(ExcelCellService excelCellService)
      • setExcelSheetNamingStrategy

        public void setExcelSheetNamingStrategy​(ExcelSheetNamingStrategy excelSheetNamingStrategy)
      • setExcelWorkbookService

        public void setExcelWorkbookService​(ExcelWorkbookService excelWorkbookService)