|
1 | 1 | package model; |
2 | 2 |
|
3 | | -import exceptions.SheetAlreadyExistsException; |
4 | 3 | import lombok.AllArgsConstructor; |
5 | 4 | import lombok.EqualsAndHashCode; |
6 | 5 | import lombok.Getter; |
7 | 6 | import org.apache.poi.ss.usermodel.Cell; |
8 | 7 | import org.apache.poi.ss.usermodel.Row; |
9 | 8 | import org.apache.poi.ss.usermodel.Sheet; |
10 | | -import org.apache.poi.ss.usermodel.Workbook; |
11 | 9 |
|
12 | 10 | import java.util.LinkedList; |
13 | 11 | import java.util.List; |
@@ -37,36 +35,6 @@ public class ExcelSheet { |
37 | 35 | */ |
38 | 36 | private String name; |
39 | 37 |
|
40 | | - /** |
41 | | - * Create a new Sheet |
42 | | - * @param excelWorkbook The Workbook where to create the Sheet |
43 | | - * @return A ExcelSheet |
44 | | - * @throws SheetAlreadyExistsException If a Sheet with that name already exists |
45 | | - */ |
46 | | - public static ExcelSheet create(ExcelWorkbook excelWorkbook) throws SheetAlreadyExistsException { |
47 | | - return create(excelWorkbook, null); |
48 | | - } |
49 | | - |
50 | | - /** |
51 | | - * Create a new Sheet |
52 | | - * @param excelWorkbook The Workbook where to create the Sheet |
53 | | - * @param sheetName The name of the sheet |
54 | | - * @return A ExcelSheet |
55 | | - * @throws SheetAlreadyExistsException If a Sheet with that name already exists |
56 | | - */ |
57 | | - public static ExcelSheet create(ExcelWorkbook excelWorkbook, String sheetName) throws SheetAlreadyExistsException { |
58 | | - Workbook workbook = excelWorkbook.getWorkbook(); |
59 | | - Sheet sheet; |
60 | | - try { |
61 | | - sheet = (sheetName == null || sheetName.isEmpty()) |
62 | | - ? workbook.createSheet() |
63 | | - : workbook.createSheet(sheetName); |
64 | | - } catch (IllegalArgumentException e) { |
65 | | - throw new SheetAlreadyExistsException(e.getMessage(), e.getCause()); |
66 | | - } |
67 | | - return new ExcelSheet(sheet, workbook.getSheetIndex(sheet), sheet.getSheetName()); |
68 | | - } |
69 | | - |
70 | 38 | /** |
71 | 39 | * Returns the Workbook to which it belongs |
72 | 40 | * @return A ExcelWorkbook |
|
0 commit comments