Skip to content

Commit 0cd624b

Browse files
committed
RELEASE v0.5.0
1 parent ba66777 commit 0cd624b

File tree

5 files changed

+45
-5
lines changed

5 files changed

+45
-5
lines changed

CHANGELOG.MD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# v0.5.0
2+
### Features
3+
* Methods for writing a matrix of values starting from a source cell or in append and the method for deleting a matrix of cells has been added to Excel Sheet
4+
* Wrapper classes can be initialized with static of() methods
5+
* There are methods parseToObject() and parseToList() in ExcelSheet which allow, through defined rules, to assign the values of precise cells to the fields of an object.
6+
### Fixes
7+
* The readValue() method correctly returns the Date type
8+
* The readValue(Class<?> type) method checks better if the return value is a date
9+
### Removed
10+
* Methods that have been deprecated since v0.4.0 have been removed
11+
### Changes
12+
* Constructor methods of wrapper classes are now private
13+
* The writeValue() method uses the yyyy-MM-dd and yyyy-MM-dd HH:mm style to represent date and time
14+
115
# v0.4.2
216
### Features
317
* Now there is a method to zip a list of files

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[![Maven Central](https://img.shields.io/maven-central/v/io.github.mbenincasa/java-excel-utils.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.mbenincasa%22%20AND%20a:%22java-excel-utils%22)
22
[![GitHub release](https://img.shields.io/github/release/MBenincasa/java-excel-utils)](https://github.com/MBenincasa/java-excel-utils/releases/)
3-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)<br>
4+
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=WXYAJVFZD82BJ)
45

56
# Java Excel Utils
67

@@ -32,6 +33,14 @@ public void toPOI() {
3233
Row row = excelRow.getRow();
3334
Cell cell = excelCell.getCell();
3435
}
36+
37+
public void fromPOI() {
38+
// Initialize the components
39+
ExcelWorkbook excelWorkbook = ExcelWorkbook.of(workbook);
40+
ExcelSheet excelSheet = ExcelSheet.of(sheet);
41+
ExcelRow excelRow = ExcelRow.of(row);
42+
ExcelCell excelCell = ExcelCell.of(cell);
43+
}
3544
```
3645

3746
One of the main features of the library is to be able to perform conversions. The **Converter** class has methods that convert **EXCEL <-> POJOs**, **EXCEL <-> CSV** and **EXCEL <-> JSON**<br>
@@ -59,6 +68,18 @@ public void objectsToExcel() {
5968
}
6069
```
6170

71+
ExcelSheet provides two methods for parsing the Sheet into an object or a list of objects.<br>
72+
The advantage of these methods comes from the annotations and the mapping class that allow you to define the positions of the values of each field and the rules on how the various objects are positioned
73+
```
74+
public void parseSheet() {
75+
ExcelWorkbook excelWorkbook = ExcelWorkbook.open(file);
76+
ExcelSheet excelSheet = excelWorkbook.getSheet("DATA");
77+
Employee employee = excelSheet.parseToObject(Employee.class, "A1");
78+
ExcelListParserMapping mapping = new ExcelListParserMapping("A1", Direction.VERTICAL, 8);
79+
List<Employee> employees = excelSheet.parseToList(Employee.class, mapping);
80+
}
81+
```
82+
6283
ExcelCell provides generic methods for reading a cell.
6384
```
6485
public void readValue() {
@@ -91,7 +112,7 @@ Java 17 or above.
91112
<dependency>
92113
<groupId>io.github.mbenincasa</groupId>
93114
<artifactId>java-excel-utils</artifactId>
94-
<version>0.4.2</version>
115+
<version>0.5.0</version>
95116
</dependency>
96117
```
97118

@@ -115,3 +136,7 @@ Distributed under the GNU General Public License v3.0. See `LICENSE.md` for more
115136

116137
## Contact
117138
Mirko Benincasa - [email protected]
139+
140+
## Donations
141+
Another way to support and contribute to the project is by sending a donation. The project will always be free and open source.<br>
142+
Click [here](https://www.paypal.com/donate/?hosted_button_id=WXYAJVFZD82BJ) to make a donation on PayPal

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
The following versions of this project are currently being supported with security updates:
55
| Version | Supported |
66
|:-----------:|:--------------------:|
7-
| v0.4.x | :white_check_mark: |
8-
| < v0.3.y | :x: |
7+
| v0.5.x | :white_check_mark: |
8+
| < v0.4.y | :x: |
99

1010
### Reporting a Vulnerability
1111

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.4.2</version>
9+
<version>0.5.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>

src/main/java/io/github/mbenincasa/javaexcelutils/model/excel/ExcelSheet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ public <T> T parseToObject(Class<T> clazz, String startingCell) throws NoSuchMet
306306
* @throws NoSuchMethodException If the setting method or empty constructor of the object is not found
307307
* @throws InstantiationException If an error occurs while instantiating a new object
308308
* @throws IllegalAccessException If a field or fields of the {@code clazz} could not be accessed
309+
* @since 0.5.0
309310
*/
310311
public <T> List<T> parseToList(Class<T> clazz, ExcelListParserMapping mapping) throws ReadValueException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
311312
List<T> objectList = new LinkedList<>();

0 commit comments

Comments
 (0)