|
16 | 16 | public interface SpreadsheetReader {
|
17 | 17 |
|
18 | 18 |
|
19 |
| - // Read with row eventHandler |
20 |
| - |
21 |
| - <T> void read(Class<T> beanClz, File file, RowListener<T> eventHandler) throws SpreadsheetReadException; |
22 |
| - |
23 |
| - <T> void read(Class<T> beanClz, InputStream is, RowListener<T> eventHandler) throws SpreadsheetReadException; |
24 |
| - |
25 |
| - |
26 |
| - <T> void read(Class<T> beanClz, File file, int sheetNo, RowListener<T> eventHandler) |
27 |
| - throws SpreadsheetReadException; |
28 |
| - |
29 |
| - <T> void read(Class<T> beanClz, InputStream is, int sheetNo, RowListener<T> eventHandler) |
| 19 | + // Read with Custom RowListener |
| 20 | + |
| 21 | + /** |
| 22 | + * Reads the spreadsheet file to beans of the given type. This method will attempt to read all |
| 23 | + * the available sheets of the file and creates the objects of the passed type. |
| 24 | + * |
| 25 | + * <p> |
| 26 | + * The {@link RowListener} implementation callback gets triggered after reading each Row. Best |
| 27 | + * Suited for reading Large files in restricted memory environments. |
| 28 | + * </p> |
| 29 | + * |
| 30 | + * @param <T> The Parameterized bean Class. |
| 31 | + * @param beanClz The Class type to deserialize the rows data |
| 32 | + * @param file {@link File} object of the spreadsheet file |
| 33 | + * @param listener Custom {@link RowListener} implementation for row data callbacks. |
| 34 | + * |
| 35 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 36 | + * readable or row data to bean mapping failed. |
| 37 | + */ |
| 38 | + <T> void read(Class<T> beanClz, File file, RowListener<T> listener) throws SpreadsheetReadException; |
| 39 | + |
| 40 | + |
| 41 | + /** |
| 42 | + * Reads the spreadsheet file to beans of the given type. This method will attempt to read all |
| 43 | + * the available sheets of the file and creates the objects of the passed type. |
| 44 | + * |
| 45 | + * <p> |
| 46 | + * The {@link RowListener} implementation callback gets triggered after reading each Row. Best |
| 47 | + * Suited for reading Large files in restricted memory environments. |
| 48 | + * </p> |
| 49 | + * |
| 50 | + * @param <T> The Parameterized bean Class. |
| 51 | + * @param beanClz The Class type to deserialize the rows data |
| 52 | + * @param is {@link InputStream} of the spreadsheet file |
| 53 | + * @param listener Custom {@link RowListener} implementation for row data callbacks. |
| 54 | + * |
| 55 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 56 | + * readable or row data to bean mapping failed. |
| 57 | + */ |
| 58 | + <T> void read(Class<T> beanClz, InputStream is, RowListener<T> listener) throws SpreadsheetReadException; |
| 59 | + |
| 60 | + |
| 61 | + /** |
| 62 | + * Reads the spreadsheet file to beans of the given type. Note that only the requested sheet |
| 63 | + * (sheet numbers are indexed from 0) will be read. |
| 64 | + * |
| 65 | + * <p> |
| 66 | + * The {@link RowListener} implementation callback gets triggered after reading each Row. Best |
| 67 | + * Suited for reading Large files in restricted memory environments. |
| 68 | + * </p> |
| 69 | + * |
| 70 | + * @param <T> The Parameterized bean Class. |
| 71 | + * @param beanClz The Class type to deserialize the rows data |
| 72 | + * @param file {@link File} object of the spreadsheet file |
| 73 | + * @param sheetNo index of the Sheet to be read (index starts from 0) |
| 74 | + * @param listener Custom {@link RowListener} implementation for row data callbacks. |
| 75 | + * |
| 76 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 77 | + * readable or row data to bean mapping failed. |
| 78 | + */ |
| 79 | + <T> void read(Class<T> beanClz, File file, int sheetNo, RowListener<T> listener) throws SpreadsheetReadException; |
| 80 | + |
| 81 | + |
| 82 | + /** |
| 83 | + * Reads the spreadsheet file to beans of the given type. Note that only the requested sheet |
| 84 | + * (sheet numbers are indexed from 0) will be read. |
| 85 | + * |
| 86 | + * <p> |
| 87 | + * The {@link RowListener} implementation callback gets triggered after reading each Row. Best |
| 88 | + * Suited for reading Large files in restricted memory environments. |
| 89 | + * </p> |
| 90 | + * |
| 91 | + * @param <T> The Parameterized bean Class. |
| 92 | + * @param beanClz The Class type to deserialize the rows data |
| 93 | + * @param is {@link InputStream} of the spreadsheet file |
| 94 | + * @param sheetNo index of the Sheet to be read (index starts from 0) |
| 95 | + * @param listener Custom {@link RowListener} implementation for row data callbacks. |
| 96 | + * |
| 97 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 98 | + * readable or row data to bean mapping failed. |
| 99 | + */ |
| 100 | + <T> void read(Class<T> beanClz, InputStream is, int sheetNo, RowListener<T> listener) |
30 | 101 | throws SpreadsheetReadException;
|
31 | 102 |
|
32 | 103 |
|
33 | 104 |
|
34 |
| - // Read all |
| 105 | + // Read with default RowListener |
35 | 106 |
|
| 107 | + /** |
| 108 | + * Reads the spreadsheet file to beans of the given type. This method will attempt to read all |
| 109 | + * the available sheets of the file and creates the objects of the passed type. |
| 110 | + * |
| 111 | + * @param <T> The Parameterized bean Class. |
| 112 | + * @param beanClz The Class type to deserialize the rows data |
| 113 | + * @param file {@link File} object of the spreadsheet file |
| 114 | + * |
| 115 | + * @return a {@link List} of objects of the parameterized type |
| 116 | + * |
| 117 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 118 | + * readable or row data to bean mapping failed. |
| 119 | + */ |
36 | 120 | <T> List<T> read(Class<T> beanClz, File file) throws SpreadsheetReadException;
|
37 | 121 |
|
| 122 | + |
| 123 | + /** |
| 124 | + * Reads the spreadsheet file to beans of the given type. This method will attempt to read all |
| 125 | + * the available sheets of the file and creates the objects of the passed type. |
| 126 | + * |
| 127 | + * @param <T> The Parameterized bean Class. |
| 128 | + * @param beanClz The Class type to deserialize the rows data |
| 129 | + * @param is {@link InputStream} of the spreadsheet file |
| 130 | + * |
| 131 | + * @return a {@link List} of objects of the parameterized type |
| 132 | + * |
| 133 | + * @throws SpreadsheetReadException an exception is thrown in cases where the file data is not |
| 134 | + * readable or row data to bean mapping failed. |
| 135 | + */ |
38 | 136 | <T> List<T> read(Class<T> beanClz, InputStream is) throws SpreadsheetReadException;
|
39 | 137 |
|
40 | 138 |
|
| 139 | + /** |
| 140 | + * Reads the spreadsheet file to beans of the given type. Note that only the requested sheet |
| 141 | + * (sheet numbers are indexed from 0) will be read. |
| 142 | + * |
| 143 | + * @param <T> The Parameterized bean Class. |
| 144 | + * @param beanClz beanClz The Class type to deserialize the rows data |
| 145 | + * @param file file {@link File} object of the spreadsheet file |
| 146 | + * @param sheetNo index of the Sheet to be read (index starts from 0) |
| 147 | + * |
| 148 | + * @return a {@link List} of objects of the parameterized type |
| 149 | + * |
| 150 | + * @throws SpreadsheetReadException SpreadsheetReadException an exception is thrown in cases |
| 151 | + * where the file data is not readable or row data to bean mapping failed. |
| 152 | + */ |
41 | 153 | <T> List<T> read(Class<T> beanClz, File file, int sheetNo) throws SpreadsheetReadException;
|
42 | 154 |
|
| 155 | + |
| 156 | + /** |
| 157 | + * Reads the spreadsheet file to beans of the given type. Note that only the requested sheet |
| 158 | + * (sheet numbers are indexed from 0) will be read. |
| 159 | + * |
| 160 | + * @param <T> The Parameterized bean Class. |
| 161 | + * @param beanClz beanClz The Class type to deserialize the rows data |
| 162 | + * @param is {@link InputStream} of the spreadsheet file |
| 163 | + * @param sheetNo index of the Sheet to be read (index starts from 0) |
| 164 | + * |
| 165 | + * @return a {@link List} of objects of the parameterized type |
| 166 | + * |
| 167 | + * @throws SpreadsheetReadException SpreadsheetReadException an exception is thrown in cases |
| 168 | + * where the file data is not readable or row data to bean mapping failed. |
| 169 | + */ |
43 | 170 | <T> List<T> read(Class<T> beanClz, InputStream is, int sheetNo) throws SpreadsheetReadException;
|
44 | 171 |
|
45 | 172 |
|
|
0 commit comments