Interface ExcelWorkbookService

  • All Known Implementing Classes:
    DefaultExcelWorkbookService

    public interface ExcelWorkbookService
    Service responsible for operation on excel's workbook object.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addProperty​(org.apache.poi.ss.usermodel.Workbook workbook, java.lang.String key, java.lang.String value)
      Adds property to given workbook
      org.apache.poi.ss.usermodel.Workbook createWorkbook​(java.io.InputStream inputStream)
      Creates workbook object based on inputStream of excel file.
      org.apache.poi.ss.usermodel.Sheet getMetaInformationSheet​(org.apache.poi.ss.usermodel.Workbook workbook)
      Returns sheet which contains metadata about type system
      java.util.Optional<java.lang.String> getProperty​(org.apache.poi.ss.usermodel.Workbook worbook, java.lang.String key)
      Retrieves property from given workbook
      java.util.Collection<org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty> getUnderlyingProperties​(org.apache.poi.ss.usermodel.Workbook workbook)
      Retrieves underlying properties
    • Method Detail

      • createWorkbook

        org.apache.poi.ss.usermodel.Workbook createWorkbook​(@WillNotClose
                                                            java.io.InputStream inputStream)
        Creates workbook object based on inputStream of excel file. If inputStream doesn't contains excel file then new empty Workbook will be returned.
        Parameters:
        inputStream - Input stream of excel file
        Returns:
        Workbook object which represents excel file
      • getMetaInformationSheet

        org.apache.poi.ss.usermodel.Sheet getMetaInformationSheet​(@WillNotClose
                                                                  org.apache.poi.ss.usermodel.Workbook workbook)
        Returns sheet which contains metadata about type system
        Parameters:
        workbook - Workbook object which represents excel file
        Returns:
        Sheet which contains information about type system
      • addProperty

        void addProperty​(@WillNotClose
                         org.apache.poi.ss.usermodel.Workbook workbook,
                         @Nonnull
                         java.lang.String key,
                         @Nonnull
                         java.lang.String value)
        Adds property to given workbook
        Parameters:
        workbook - workbook which should be decorated by property
        key - key of property
        value - value of property
      • getProperty

        java.util.Optional<java.lang.String> getProperty​(@WillNotClose
                                                         org.apache.poi.ss.usermodel.Workbook worbook,
                                                         @Nonnull
                                                         java.lang.String key)
        Retrieves property from given workbook
        Parameters:
        worbook - the source of the properties
        key - key of the property
        Returns:
        value of searching property
      • getUnderlyingProperties

        java.util.Collection<org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty> getUnderlyingProperties​(@WillNotClose
                                                                                                                                  org.apache.poi.ss.usermodel.Workbook workbook)
        Retrieves underlying properties
        Parameters:
        workbook - the source of the properties
        Returns:
        collection of underlying properties