Skip to content

Commit 87cfd8d

Browse files
committed
Merge branch 'v3.x.x'
2 parents 674c22e + b5abd1f commit 87cfd8d

32 files changed

+1739
-890
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: java
22
jdk:
3-
- openjdk8
3+
- openjdk11
44

55
env:
66
- CODECOV_TOKEN="6f3f7d4d-3eab-4605-b631-294c4fb7a58f"

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ This library is available in [Maven Central](https://mvnrepository.com/artifact/
2222
<dependency>
2323
<groupId>io.github.millij</groupId>
2424
<artifactId>poi-object-mapper</artifactId>
25-
<version>2.1.0</version>
25+
<version>3.0.0</version>
2626
</dependency>
2727
```
2828

2929
To install manually, please check the [releases](https://github.com/millij/poi-object-mapper/releases) page for available versions and change log.
3030

3131
#### Dependencies
3232

33-
The current implementation uses **POI version 4.1.2**.
33+
The current implementation uses **POI version 5.2.5**.
3434

3535

3636
## Usage
@@ -48,7 +48,7 @@ Consider the below sample spreadsheet, where data of employees is present.
4848

4949
##### Mapping Rows to a Java Bean
5050

51-
Create a java bean and map its properties to the columns using the `@SheetColumn` annotation. The `@SheetColumn` annotation can be declared on the `Field`, as well as its `Accessor Methods`. Pick any one of them to configure the mapped `Column` as per convenience.
51+
Create a java bean and map its properties to the columns using the `@SheetColumn` annotation. The `@SheetColumn` annotation can be declared on the `Field`, as well as its `Accessor Methods`. Pick any one of them to configure the mapped `Column` as per convenience.
5252

5353
```java
5454
@Sheet
@@ -68,34 +68,38 @@ public class Employee {
6868

6969
##### Reading Rows as Java Objects
7070

71-
Once a mapped Java Bean is ready, use a `Reader` to read the file rows as objects. Use `XlsReader` for `.xls` files and `XlsxReader` for `.xlsx` files.
71+
Once a mapped Java Bean is ready, use a `Reader` to read the file rows as objects.
72+
73+
Use `XlsReader` for `.xls` files and `XlsxReader` for `.xlsx` files.
7274

7375
Reading spreadsheet rows as objects ..
7476

7577
```java
7678
...
7779
final File xlsxFile = new File("<path_to_file>");
7880
final XlsReader reader = new XlsReader();
79-
List<Employee> employees = reader.read(Employee.class, xlsxFile);
81+
final List<Employee> employees = reader.read(Employee.class, xlsxFile);
8082
...
8183
```
8284

8385
##### Writing a collection of objects to file
8486

85-
*Currently writing to `.xlsx` files only is supported*
87+
Similar to `Reader`, the mapped Java Beans can be written to files.
88+
89+
Use `XlsWriter` for `.xls` files and `XlsxWriter` for `.xlsx` files.
8690

8791
```java
8892
...
8993
// Employees
90-
List<Employee> employees = new ArrayList<Employee>();
94+
final List<Employee> employees = new ArrayList<>();
9195
employees.add(new Employee("1", "foo", 12, "MALE", 1.68));
9296
employees.add(new Employee("2", "bar", null, "MALE", 1.68));
9397
employees.add(new Employee("3", "foo bar", null, null, null));
94-
98+
9599
// Writer
96-
SpreadsheetWriter writer = new SpreadsheetWriter("<output_file_path>");
100+
final SpreadsheetWriter writer = new XlsxWriter();
97101
writer.addSheet(Employee.class, employees);
98-
writer.write();
102+
writer.write("<output_file_path>");
99103
...
100104
```
101105

@@ -107,7 +111,7 @@ Reading spreadsheet rows as objects ..
107111

108112
The known issues are already listed under [Issues Section](https://github.com/millij/poi-object-mapper/issues).
109113

110-
Please add there your bugs findings, feature requests, enhancements etc.
114+
Please add there your bugs findings, feature requests, enhancements etc.
111115

112116

113117

build.gradle

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ repositories {
1010
mavenCentral()
1111
}
1212

13+
14+
sourceCompatibility = 1.11
15+
targetCompatibility = 1.11
16+
1317
group = 'io.github.millij'
14-
version = '2.1.0'
18+
version = '3.0.0'
1519

1620

1721
dependencies {
@@ -20,23 +24,20 @@ dependencies {
2024
// ----------------------------------------------------------------------------------
2125

2226
// Slf4j
23-
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
27+
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.3'
2428

2529
// Apache Commons
26-
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
27-
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'
30+
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
2831

2932
// Apache POI
30-
compile group: 'org.apache.poi', name: 'poi', version: '4.1.2'
31-
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '4.1.2'
33+
implementation group: 'org.apache.poi', name: 'poi', version: '5.2.5'
34+
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.2.5'
3235

3336

3437
// Test compile
3538
// ----------------------------------------------------------------------------------
3639

37-
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.12'
38-
39-
testCompile group: 'junit', name: 'junit', version: '4.12'
40+
testImplementation group: 'junit', name: 'junit', version: '4.12'
4041

4142
}
4243

@@ -51,11 +52,6 @@ test {
5152
// Java
5253
// ----------------------------------------------------------------------------
5354

54-
tasks.withType(JavaCompile) {
55-
sourceCompatibility = 1.8
56-
targetCompatibility = 1.8
57-
}
58-
5955
task javadocJar(type: Jar) {
6056
classifier = 'javadoc'
6157
from javadoc

gradle/wrapper/gradle-wrapper.jar

4.32 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Dec 10 18:59:49 IST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip

0 commit comments

Comments
 (0)