Skip to content

Commit f59842f

Browse files
authored
Merge pull request #20 from MBenincasa/develop
Develop
2 parents 5d309a8 + 4ab645c commit f59842f

File tree

148 files changed

+1757
-4590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1757
-4590
lines changed

CHANGELOG.MD

+14
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

+30-6
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() {
@@ -80,19 +101,18 @@ Java 17 or above.
80101
- org.apache.poi:poi:jar:5.2.3
81102
- org.apache.poi:poi-ooxml:jar:5.2.3
82103
- org.projectlombok:lombok:jar:1.18.26
83-
- commons-beanutils:commons-beanutils:jar:1.9.4
84104
- com.opencsv:opencsv:jar:5.7.1
85-
- com.fasterxml.jackson.core:jackson-databind:jar:2.14.2
105+
- com.fasterxml.jackson.core:jackson-databind:jar:2.15.0
86106
- org.apache.logging.log4j:log4j-core:jar:2.20.0
87-
- org.junit.jupiter:junit-jupiter:jar:5.9.2
88-
- org.junit.platform:junit-platform-suite-engine:jar:1.9.2
107+
- org.junit.jupiter:junit-jupiter:jar:5.9.3
108+
- org.junit.platform:junit-platform-suite-engine:jar:1.9.3
89109

90110
## Maven
91111
```xml
92112
<dependency>
93113
<groupId>io.github.mbenincasa</groupId>
94114
<artifactId>java-excel-utils</artifactId>
95-
<version>0.4.2</version>
115+
<version>0.5.0</version>
96116
</dependency>
97117
```
98118

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

117137
## Contact
118138
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

+2-2
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

0 commit comments

Comments
 (0)