Class DefaultExcelWorkbookService
- java.lang.Object
-
- com.hybris.backoffice.excel.template.workbook.DefaultExcelWorkbookService
-
- All Implemented Interfaces:
ExcelWorkbookService
public class DefaultExcelWorkbookService extends java.lang.Object implements ExcelWorkbookService
Default implementation ofExcelWorkbookService
-
-
Constructor Summary
Constructors Constructor Description DefaultExcelWorkbookService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(org.apache.poi.ss.usermodel.Workbook workbook, java.lang.String key, java.lang.String value)Adds property to given workbookorg.apache.poi.ss.usermodel.WorkbookcreateWorkbook(java.io.InputStream is)Creates workbook object based on inputStream of excel file.org.apache.poi.ss.usermodel.SheetgetMetaInformationSheet(org.apache.poi.ss.usermodel.Workbook workbook)Returns sheet which contains metadata about type systemprotected 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 workbookjava.util.Collection<org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty>getUnderlyingProperties(org.apache.poi.ss.usermodel.Workbook workbook)Retrieves underlying propertiesvoidsetMetaInformationSheet(ExcelTemplateConstants.UtilitySheet metaInformationSheet)
-
-
-
Method Detail
-
getMetaInformationSheet
public org.apache.poi.ss.usermodel.Sheet getMetaInformationSheet(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook)Description copied from interface:ExcelWorkbookServiceReturns sheet which contains metadata about type system- Specified by:
getMetaInformationSheetin interfaceExcelWorkbookService- Parameters:
workbook-Workbookobject which represents excel file- Returns:
Sheetwhich contains information about type system
-
createWorkbook
public org.apache.poi.ss.usermodel.Workbook createWorkbook(@WillNotClose java.io.InputStream is)Description copied from interface:ExcelWorkbookServiceCreates workbook object based on inputStream of excel file. If inputStream doesn't contains excel file then new empty Workbook will be returned.- Specified by:
createWorkbookin interfaceExcelWorkbookService- Parameters:
is- Input stream of excel file- Returns:
Workbookobject 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:ExcelWorkbookServiceAdds property to given workbook- Specified by:
addPropertyin interfaceExcelWorkbookService- Parameters:
workbook- workbook which should be decorated by propertykey- key of propertyvalue- 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:ExcelWorkbookServiceRetrieves property from given workbook- Specified by:
getPropertyin interfaceExcelWorkbookService- Parameters:
workbook- the source of the propertieskey- 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:ExcelWorkbookServiceRetrieves underlying properties- Specified by:
getUnderlyingPropertiesin interfaceExcelWorkbookService- 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)
-
setMetaInformationSheet
public void setMetaInformationSheet(ExcelTemplateConstants.UtilitySheet metaInformationSheet)
-
-