Skip to content

Commit

Permalink
Merge pull request #20 from MBenincasa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MBenincasa authored May 20, 2023
2 parents 5d309a8 + 4ab645c commit f59842f
Show file tree
Hide file tree
Showing 148 changed files with 1,757 additions and 4,590 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.5.0
### Features
* 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
* Wrapper classes can be initialized with static of() methods
* 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.
### Fixes
* The readValue() method correctly returns the Date type
* The readValue(Class<?> type) method checks better if the return value is a date
### Removed
* Methods that have been deprecated since v0.4.0 have been removed
### Changes
* Constructor methods of wrapper classes are now private
* The writeValue() method uses the yyyy-MM-dd and yyyy-MM-dd HH:mm style to represent date and time

# v0.4.2
### Features
* Now there is a method to zip a list of files
Expand Down
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![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)
[![GitHub release](https://img.shields.io/github/release/MBenincasa/java-excel-utils)](https://github.com/MBenincasa/java-excel-utils/releases/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)<br>
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=WXYAJVFZD82BJ)

# Java Excel Utils

Expand Down Expand Up @@ -32,6 +33,14 @@ public void toPOI() {
Row row = excelRow.getRow();
Cell cell = excelCell.getCell();
}
public void fromPOI() {
// Initialize the components
ExcelWorkbook excelWorkbook = ExcelWorkbook.of(workbook);
ExcelSheet excelSheet = ExcelSheet.of(sheet);
ExcelRow excelRow = ExcelRow.of(row);
ExcelCell excelCell = ExcelCell.of(cell);
}
```

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>
Expand Down Expand Up @@ -59,6 +68,18 @@ public void objectsToExcel() {
}
```

ExcelSheet provides two methods for parsing the Sheet into an object or a list of objects.<br>
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
```
public void parseSheet() {
ExcelWorkbook excelWorkbook = ExcelWorkbook.open(file);
ExcelSheet excelSheet = excelWorkbook.getSheet("DATA");
Employee employee = excelSheet.parseToObject(Employee.class, "A1");
ExcelListParserMapping mapping = new ExcelListParserMapping("A1", Direction.VERTICAL, 8);
List<Employee> employees = excelSheet.parseToList(Employee.class, mapping);
}
```

ExcelCell provides generic methods for reading a cell.
```
public void readValue() {
Expand All @@ -80,19 +101,18 @@ Java 17 or above.
- org.apache.poi:poi:jar:5.2.3
- org.apache.poi:poi-ooxml:jar:5.2.3
- org.projectlombok:lombok:jar:1.18.26
- commons-beanutils:commons-beanutils:jar:1.9.4
- com.opencsv:opencsv:jar:5.7.1
- com.fasterxml.jackson.core:jackson-databind:jar:2.14.2
- com.fasterxml.jackson.core:jackson-databind:jar:2.15.0
- org.apache.logging.log4j:log4j-core:jar:2.20.0
- org.junit.jupiter:junit-jupiter:jar:5.9.2
- org.junit.platform:junit-platform-suite-engine:jar:1.9.2
- org.junit.jupiter:junit-jupiter:jar:5.9.3
- org.junit.platform:junit-platform-suite-engine:jar:1.9.3

## Maven
```xml
<dependency>
<groupId>io.github.mbenincasa</groupId>
<artifactId>java-excel-utils</artifactId>
<version>0.4.2</version>
<version>0.5.0</version>
</dependency>
```

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

## Contact
Mirko Benincasa - [email protected]

## Donations
Another way to support and contribute to the project is by sending a donation. The project will always be free and open source.<br>
Click [here](https://www.paypal.com/donate/?hosted_button_id=WXYAJVFZD82BJ) to make a donation on PayPal
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
The following versions of this project are currently being supported with security updates:
| Version | Supported |
|:-----------:|:--------------------:|
| v0.4.x | :white_check_mark: |
| < v0.3.y | :x: |
| v0.5.x | :white_check_mark: |
| < v0.4.y | :x: |

### Reporting a Vulnerability

Expand Down
Loading

0 comments on commit f59842f

Please sign in to comment.