Skip to content

Commit 95c9528

Browse files
committed
Release v0.4.0
1 parent 6252506 commit 95c9528

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

CHANGELOG.MD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# v0.4.0
2+
### Deprecations
3+
* All methods of the Converter class up to version 0.2.1 have been deprecated
4+
### Features
5+
* There are new methods that convert Excel <-> POJOs and Excel <-> CSV. Besides conversion between files, conversions between streams and byte arrays are now available. Data is no longer returned in a List but in a Stream
6+
* Excel <-> Json conversion is now available
7+
* The writeAndClose method is available in ExcelWorkbook
8+
* ExcelCell provides new ways to read a cell.
9+
### Fixes
10+
* The error is handled better when trying to create a Sheet already present in the Workbook
11+
* The readCell(Class<?> type) method did not always return the requested type
12+
### Removed
13+
* The WorkbookUtility and SheetUtility classes have been removed
14+
* Several ExcelUtility methods have been removed
15+
116
# v0.3.0
217
### Deprecations
318
* The WorkbookUtility and SheetUtility classes have been deprecated

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ At any time you can retrieve the associated Apache POI components.
2626

2727
```
2828
public void toPOI() {
29+
// Initialize the components
2930
Workbook workbook = excelWorkbook.getWorkbook();
3031
Sheet sheet = excelSheet.getSheet();
3132
Row row = excelRow.getRow();
@@ -36,9 +37,34 @@ public void toPOI() {
3637
One of the main features of the library is to be able to perform conversions. The **Converter** class has methods that convert **Excel <-> POJOs** and **Excel <-> CSV**.<br>
3738
This is an example of Excel to POJOs:
3839
```
39-
public void ExcelToObjects() {
40+
public void excelToObjects() {
41+
// Initialize List<ExcelToObject<?>> excelToObjects...
4042
File file = new File("./src/main/resources/car.xlsx");
41-
List<Car> cars = (List<Car>) Converter.excelToObjects(file, Car.class);
43+
Map<String, Stream<?>> map = Converter.excelFileToObjects(file, excelToObjects);
44+
for (Map.Entry<String, Stream<?>> entry : map.entrySet()) {
45+
System.out.println("Sheet: " + entry.getKey());
46+
System.out.println("Data: " + entry.getValue().toList());
47+
}
48+
}
49+
```
50+
51+
This is an example of POJOs to Excel:
52+
```
53+
public void objectsToExcel() {
54+
// Initialize List<ObjectToExcel<?>> list...
55+
list.add(new ObjectToExcel<>("Employee", Employee.class, employeeStream));
56+
list.add(new ObjectToExcel<>("Office", Office.class, officeStream));
57+
File fileOutput = Converter.objectsToExcelFile(list, Extension.XLSX, "./src/main/resources/result", true);
58+
}
59+
```
60+
61+
ExcelCell provides generic methods for reading a cell.
62+
```
63+
public void readValue() {
64+
// Initialize ExcelCell excelCell...
65+
Integer intVal = excelCell.readValue(Integer.class);
66+
Double doubleVal = excelCell.readValue();
67+
String stringVal = excelCell.readValueAsString();
4268
}
4369
```
4470

@@ -65,7 +91,7 @@ Java 17 or above.
6591
<dependency>
6692
<groupId>io.github.mbenincasa</groupId>
6793
<artifactId>java-excel-utils</artifactId>
68-
<version>0.3.0</version>
94+
<version>0.4.0</version>
6995
</dependency>
7096
```
7197

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.mbenincasa</groupId>
88
<artifactId>java-excel-utils</artifactId>
9-
<version>0.3.0</version>
9+
<version>0.4.0</version>
1010
<packaging>jar</packaging>
1111
<name>Java library with tools for Excel files</name>
1212
<description>Java library that collects tools and methods to speed up development with Excel sheets</description>

0 commit comments

Comments
 (0)