Class DefaultExcelWorkbookService
java.lang.Object
com.hybris.backoffice.excel.template.workbook.DefaultExcelWorkbookService
- All Implemented Interfaces:
ExcelWorkbookService
Default implementation of
ExcelWorkbookService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(org.apache.poi.ss.usermodel.Workbook workbook, String key, String value) Adds property to given workbookorg.apache.poi.ss.usermodel.WorkbookCreates 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 Optional<org.apache.poi.ooxml.POIXMLProperties.CustomProperties>getProperties(org.apache.poi.ss.usermodel.Workbook workbook) getProperty(org.apache.poi.ss.usermodel.Workbook workbook, String key) Retrieves property from given workbookCollection<org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty>getUnderlyingProperties(org.apache.poi.ss.usermodel.Workbook workbook) Retrieves underlying propertiesvoidsetMetaInformationSheet(ExcelTemplateConstants.UtilitySheet metaInformationSheet)
-
Constructor Details
-
DefaultExcelWorkbookService
public DefaultExcelWorkbookService()
-
-
Method Details
-
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
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 String key, @Nonnull 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 Optional<String> getProperty(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook, @Nonnull 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 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 Optional<org.apache.poi.ooxml.POIXMLProperties.CustomProperties> getProperties(org.apache.poi.ss.usermodel.Workbook workbook) -
setMetaInformationSheet
-