Skip to content

vaa25/poiji2

Repository files navigation

Poiji2

This is an advanced fork of https://github.com/ozlerhakan/poiji.
Many thanks to ozlerhakan for inspiration.

Apache POI library required as dependency to work with xlsx and xls. Tested with dependency 'org.apache.poi:poi-ooxml:4.1.2'.

In your Maven/Gradle project, first add the corresponding dependency:

maven
<dependencies>
    <dependency>
        <groupId>io.github.vaa25</groupId>
        <artifactId>poiji2</artifactId>
        <version>1.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>5.2.5</version>
    </dependency>
</dependencies>
gradle
dependencies {
    implementation 'io.github.vaa25:poiji2:1.4.0'
    implementation 'org.apache.poi:poi-ooxml:5.2.5'
}

Supported all features of original Poiji implemented before 2021.

Also:

  • Poiji2 is thread-safe.

  • Poiji2 reads 30% faster than Poiji (see ConcurrentTest: synchronized read for Poiji vs synchronized optimized read for Poiji2).

  • Poiji2 can write (use Poiji.toExcel(…​)).

  • Poiji2 can work with CSV (use PoijiExcelType.CSV, can be used without poi-ooxml dependency).

  • Poiji2 can transpose sheet (use PoijiOptions.transposed). WARNING! Whole document loaded in memory.

  • Poiji2 has mandatory column validation (use @ExcelCellName.mandatory).

  • Poiji2 can collect parse exceptions in Entity object (use @ExcelParseExceptions on Map<String, ExcelParseException>).

  • Poiji2 can transform excel to Stream (use Poiji.fromExcelToStream(…​)). WARNING! XLSX takes double time more than transform to List.

  • Poiji2 has usable builders for any case (ex. use Poiji.<JavaClass>fromExcel().withSource(new File(…​)).withJavaType(JavaClass.class).toStream())

  • Poiji2 (since v1.2.1) can be used with spring-boot-starter-web-excel

  • Poiji2 can read lists in row (use @ExcelList on List)

  • Poiji2 can read and write huge xlsx files (see HugeTest.java)

  • Poiji2 (since v1.4.0) can work with immutable java classes (see IgnoreTest.java). lombok @Value and java records applicable also.