Class DefaultExcelWorkbookService

    • Method Summary

      All Methods Instance Methods Concrete 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 is)
      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
      protected java.util.Optional<org.apache.poi.ooxml.POIXMLProperties.CustomProperties> getProperties​(org.apache.poi.ss.usermodel.Workbook workbook)  
      java.util.Optional<java.lang.String> getProperty​(org.apache.poi.ss.usermodel.Workbook workbook, 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
      void setMetaInformationSheet​(ExcelTemplateConstants.UtilitySheet metaInformationSheet)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultExcelWorkbookService

        public DefaultExcelWorkbookService()
    • Method Detail

      • getMetaInformationSheet

        public org.apache.poi.ss.usermodel.Sheet getMetaInformationSheet​(@WillNotClose
                                                                         org.apache.poi.ss.usermodel.Workbook workbook)
        Description copied from interface: ExcelWorkbookService
        Returns sheet which contains metadata about type system
        Specified by:
        getMetaInformationSheet in interface ExcelWorkbookService
        Parameters:
        workbook - Workbook object which represents excel file
        Returns:
        Sheet which contains information about type system
      • createWorkbook

        public org.apache.poi.ss.usermodel.Workbook createWorkbook​(@WillNotClose
                                                                   java.io.InputStream is)
        Description copied from interface: ExcelWorkbookService
        Creates workbook object based on inputStream of excel file. If inputStream doesn't contains excel file then new empty Workbook will be returned.
        Specified by:
        createWorkbook in interface ExcelWorkbookService
        Parameters:
        is - Input stream of excel file
        Returns:
        Workbook object which represents excel file
      • addProperty

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

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

        public java.util.Collection<org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty> getUnderlyingProperties​(org.apache.poi.ss.usermodel.Workbook workbook)
        Description copied from interface: ExcelWorkbookService
        Retrieves underlying properties
        Specified by:
        getUnderlyingProperties in interface ExcelWorkbookService
        Parameters:
        workbook - the source of the properties
        Returns:
        collection of underlying properties
      • getProperties

        protected java.util.Optional<org.apache.poi.ooxml.POIXMLProperties.CustomProperties> getProperties​(org.apache.poi.ss.usermodel.Workbook workbook)