Skip to content

Commit e58e17f

Browse files
authored
Merge pull request #6 from MBenincasa/develop
Develop
2 parents f6b4a25 + 37a15f0 commit e58e17f

Some content is hidden

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

42 files changed

+186
-182
lines changed

README.md

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,58 @@
55
# Java Excel Utils
66

77
## Introduction
8-
Java Excel Utils is still an embryonic project. This open source library will collect different tools to speed up the work with Excel files.
8+
Java Excel Utils is a Java library with the aim of making working with Microsoft Excel sheets easier. The library uses Apache POI components extending their potential.<br>
9+
10+
## Quickstart
11+
There are wrapper classes for the main components of an Excel sheet: **ExcelWorkbook**, **ExcelSheet**, **ExcelRow** and **ExcelCell**.
12+
```
13+
public void modelTest() {
14+
ExcelWorkbook excelWorkbook = ExcelWorkbook.create(Extension.XLSX);
15+
ExcelSheet excelSheet = excelWorkbook.createSheet("TEST");
16+
ExcelRow excelRow = excelSheet.createRow(0);
17+
ExcelCell excelCell = excelRow.createCell(0);
18+
excelCell.writeValue("Rossi");
19+
String lastName = excelCell.readValue(String.class);
20+
}
21+
```
22+
23+
This code snippet shows how wrappat components can be instantiated. The last lines show how it is possible to write and read inside a cell.<br>
24+
The classes have many other features, such as the ability to count the number of rows and columns present excluding, if you want, the empty ones.<p>
25+
At any time you can retrieve the associated Apache POI components.
26+
27+
```
28+
public void toPOI() {
29+
Workbook workbook = excelWorkbook.getWorkbook();
30+
Sheet sheet = excelSheet.getSheet();
31+
Row row = excelRow.getRow();
32+
Cell cell = excelCell.getCell();
33+
}
34+
```
35+
36+
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>
37+
This is an example of Excel to POJOs:
38+
```
39+
public void ExcelToObjects() {
40+
File file = new File("./src/main/resources/car.xlsx");
41+
List<Car> cars = (List<Car>) Converter.excelToObjects(file, Car.class);
42+
}
43+
```
944

1045
## Documentation
11-
The javadocs of all public methods are available. Some examples are also available in the `samples` package.
46+
At the moment a real documentation is not yet available, but the javadocs and some examples are available in the `samples` package.<br>
47+
Click [here](https://repo1.maven.org/maven2/io/github/mbenincasa/java-excel-utils/0.3.0/java-excel-utils-0.3.0-javadoc.jar) to download the javadocs.
1248

1349
## Minimum Requirements
1450
Java 17 or above.
1551

1652
## Dependencies
17-
```xml
18-
<dependencies>
19-
<dependency>
20-
<groupId>org.apache.poi</groupId>
21-
<artifactId>poi</artifactId>
22-
<version>5.2.3</version>
23-
</dependency>
24-
<dependency>
25-
<groupId>org.apache.poi</groupId>
26-
<artifactId>poi-ooxml</artifactId>
27-
<version>5.2.3</version>
28-
</dependency>
29-
<dependency>
30-
<groupId>org.projectlombok</groupId>
31-
<artifactId>lombok</artifactId>
32-
<version>1.18.24</version>
33-
<scope>provided</scope>
34-
</dependency>
35-
<dependency>
36-
<groupId>commons-beanutils</groupId>
37-
<artifactId>commons-beanutils</artifactId>
38-
<version>1.9.4</version>
39-
</dependency>
40-
<dependency>
41-
<groupId>com.opencsv</groupId>
42-
<artifactId>opencsv</artifactId>
43-
<version>5.7.1</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>org.junit.jupiter</groupId>
47-
<artifactId>junit-jupiter</artifactId>
48-
<version>5.9.2</version>
49-
<scope>test</scope>
50-
</dependency>
51-
<dependency>
52-
<groupId>org.junit.platform</groupId>
53-
<artifactId>junit-platform-suite-engine</artifactId>
54-
<version>1.9.2</version>
55-
<scope>test</scope>
56-
</dependency>
57-
</dependencies>
58-
```
53+
- org.apache.poi:poi:jar:5.2.3
54+
- org.apache.poi:poi-ooxml:jar:5.2.3
55+
- org.projectlombok:lombok:jar:1.18.24
56+
- commons-beanutils:commons-beanutils:jar:1.9.4
57+
- com.opencsv:opencsv:jar:5.7.1
58+
- org.junit.jupiter:junit-jupiter:jar:5.9.2
59+
- org.junit.platform:junit-platform-suite-engine:jar:1.9.2
5960

6061
## Maven
6162
```xml
@@ -67,7 +68,8 @@ Java 17 or above.
6768
```
6869

6970
## Roadmap
70-
There is still no well-defined roadmap, but there is the idea of bringing various features
71+
**Version 0.4.0** will bring new features to the Converter class. Current conversions will be reviewed. Conversions will be available that will also work with Stream I/O and byte[] in addition to the already present File.<p>
72+
In the future, new features will come that have not yet been well defined.
7173

7274
## Contributing
7375
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

src/main/java/annotations/ExcelBodyStyle.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/annotations/ExcelBodyStyle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package annotations;
1+
package io.github.mbenincasa.javaexcelutils.annotations;
22

33
import org.apache.poi.ss.usermodel.HorizontalAlignment;
44
import org.apache.poi.ss.usermodel.IndexedColors;

src/main/java/annotations/ExcelField.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/annotations/ExcelField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package annotations;
1+
package io.github.mbenincasa.javaexcelutils.annotations;
22

33
import java.lang.annotation.ElementType;
44
import java.lang.annotation.Retention;

src/main/java/annotations/ExcelHeaderStyle.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/annotations/ExcelHeaderStyle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package annotations;
1+
package io.github.mbenincasa.javaexcelutils.annotations;
22

33
import org.apache.poi.ss.usermodel.HorizontalAlignment;
44
import org.apache.poi.ss.usermodel.IndexedColors;

src/main/java/enums/Extension.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/enums/Extension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package enums;
1+
package io.github.mbenincasa.javaexcelutils.enums;
22

3-
import exceptions.ExtensionNotValidException;
3+
import io.github.mbenincasa.javaexcelutils.exceptions.ExtensionNotValidException;
44
import lombok.AllArgsConstructor;
55
import lombok.Getter;
66

src/main/java/exceptions/ExtensionNotValidException.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/exceptions/ExtensionNotValidException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package exceptions;
1+
package io.github.mbenincasa.javaexcelutils.exceptions;
22

33
/**
44
* This exception signals that the extension is invalid

src/main/java/exceptions/FileAlreadyExistsException.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/exceptions/FileAlreadyExistsException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package exceptions;
1+
package io.github.mbenincasa.javaexcelutils.exceptions;
22

33
/**
44
* This exception signals that the file already exists

src/main/java/exceptions/HeaderNotPresentException.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/exceptions/HeaderNotPresentException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package exceptions;
1+
package io.github.mbenincasa.javaexcelutils.exceptions;
22

33
/**
44
* This exception signals that the file header is missing

src/main/java/exceptions/OpenWorkbookException.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/exceptions/OpenWorkbookException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package exceptions;
1+
package io.github.mbenincasa.javaexcelutils.exceptions;
22

33
/**
44
* This exception signals that an error occurred while opening an Excel file workbook

src/main/java/exceptions/ReadValueException.java renamed to src/main/java/io/github/mbenincasa/javaexcelutils/exceptions/ReadValueException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package exceptions;
1+
package io.github.mbenincasa.javaexcelutils.exceptions;
22

33
/**
44
* This exception signals that there was an error reading a cell value

0 commit comments

Comments
 (0)