Class DefaultExcelSheetService
java.lang.Object
com.hybris.backoffice.excel.template.sheet.DefaultExcelSheetService
- All Implemented Interfaces:
ExcelSheetService
Default implementation of
ExcelSheetService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.poi.ss.usermodel.SheetcreateOrGetTypeSheet(org.apache.poi.ss.usermodel.Workbook workbook, String typeCode) Creates a new type sheet in given workbook.org.apache.poi.ss.usermodel.SheetcreateOrGetUtilitySheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) Creates a new utility sheet in given workbook.org.apache.poi.ss.usermodel.SheetcreateTypeSheet(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) Creates a new sheet and adds it to given workbook.protected StringfindAttributeDisplayNameInTypeSystemSheet(org.apache.poi.ss.usermodel.Sheet typeSystemSheet, ExcelAttribute excelAttribute, String typeCode) intfindColumnIndex(org.apache.poi.ss.usermodel.Sheet typeSystemSheet, org.apache.poi.ss.usermodel.Sheet sheet, ExcelAttribute excelAttribute) Finds column index based on selected attribute.findSheetNameForTypeCode(org.apache.poi.ss.usermodel.Workbook workbook, String typeCode) Finds sheet name for given type code.findTypeCodeForSheetName(org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) Finds type code for given sheet name.Collection<org.apache.poi.ss.usermodel.Sheet>getSheets(org.apache.poi.ss.usermodel.Workbook workbook) Returns all sheets except utility sheets.getSheetsNames(org.apache.poi.ss.usermodel.Workbook workbook) Returns all sheets names except utility sheets.voidsetAttributeNameFormatter(AttributeNameFormatter<ExcelAttributeDescriptorAttribute> attributeNameFormatter) voidsetCollectionFormatter(CollectionFormatter collectionFormatter) voidsetExcelCellService(ExcelCellService excelCellService) voidsetExcelSheetNamingStrategy(ExcelSheetNamingStrategy excelSheetNamingStrategy) voidsetExcelWorkbookService(ExcelWorkbookService excelWorkbookService) voidsetExcludedSheets(Collection<ExcelTemplateConstants.UtilitySheet> excludedSheets) voidsetHeaderRowIndex(ExcelTemplateConstants.Header headerRowIndex) voidsetTypeTemplate(ExcelTemplateConstants.UtilitySheet typeTemplate) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hybris.backoffice.excel.template.sheet.ExcelSheetService
createEmptyRow, getSheet
-
Constructor Details
-
DefaultExcelSheetService
public DefaultExcelSheetService()
-
-
Method Details
-
getSheetsNames
public Collection<String> getSheetsNames(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook) Description copied from interface:ExcelSheetServiceReturns all sheets names except utility sheets.- Specified by:
getSheetsNamesin interfaceExcelSheetService- Parameters:
workbook-Workbookobject which represents excel file- Returns:
- collection of sheets names
-
getSheets
public Collection<org.apache.poi.ss.usermodel.Sheet> getSheets(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook) Description copied from interface:ExcelSheetServiceReturns all sheets except utility sheets.- Specified by:
getSheetsin interfaceExcelSheetService- Parameters:
workbook-Workbookobject 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 String typeCode) Description copied from interface:ExcelSheetServiceCreates 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:
createOrGetTypeSheetin interfaceExcelSheetService- Parameters:
workbook- workbook which will be extended by a new sheettypeCode- 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 String sheetName) Description copied from interface:ExcelSheetServiceCreates a new sheet and adds it to given workbook.- Specified by:
createTypeSheetin interfaceExcelSheetService- Parameters:
workbook- workbook which will be extended by a new sheetsheetName- 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 String sheetName) Description copied from interface:ExcelSheetServiceCreates 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:
createOrGetUtilitySheetin interfaceExcelSheetService- Parameters:
workbook- workbook which will be extended by a new sheetsheetName- 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:ExcelSheetServiceFinds column index based on selected attribute. If column doesn't exist then -1 will be returned.- Specified by:
findColumnIndexin interfaceExcelSheetService- Parameters:
typeSystemSheet- sheet which contains information about type systemsheet- sheet for current typeexcelAttribute- 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 String findTypeCodeForSheetName(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) Description copied from interface:ExcelSheetServiceFinds type code for given sheet name.- Specified by:
findTypeCodeForSheetNamein interfaceExcelSheetService- Parameters:
workbook- workbooksheetName- sheet name- Returns:
- found type code.
-
findSheetNameForTypeCode
public String findSheetNameForTypeCode(@WillNotClose org.apache.poi.ss.usermodel.Workbook workbook, String typeCode) Description copied from interface:ExcelSheetServiceFinds sheet name for given type code.- Specified by:
findSheetNameForTypeCodein interfaceExcelSheetService- Parameters:
workbook- workbooktypeCode- type code- Returns:
- found type code.
-
findAttributeDisplayNameInTypeSystemSheet
protected String findAttributeDisplayNameInTypeSystemSheet(org.apache.poi.ss.usermodel.Sheet typeSystemSheet, ExcelAttribute excelAttribute, String typeCode) -
setCollectionFormatter
-
setExcelCellService
-
setExcelSheetNamingStrategy
-
setAttributeNameFormatter
public void setAttributeNameFormatter(AttributeNameFormatter<ExcelAttributeDescriptorAttribute> attributeNameFormatter) -
setExcelWorkbookService
-
setExcludedSheets
-
setTypeTemplate
-
setHeaderRowIndex
-