Getting Started Excel POI

Maven Central JavaDoc

Setting up the environment

Add the Dependency to your build.

for Maven:

Java 8, 9, 10 , 11 no module-info

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi</artifactId>
    <version>8.2.3</version>
</dependency>

Java 6, 7

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi-jre6</artifactId>
    <version>8.2.3</version>
</dependency>

Java 9, 10 , 11 with module-info

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-poi-jre9</artifactId>
    <version>8.2.3</version>
</dependency>

From 7.0.0 you will need explicitly include the poi dependency in your pom.

Quick start

final SheetMapper<DbObject> sheetMapper =
        SheetMapperFactory
                .newInstance()
                .newMapper(DbObject.class);

...

    try (InputStream is = new FileInputStream("file.xls");
            Workbook workbook = new HSSFWorkbook(is)){
        sheetMapper.stream(workbook.getSheetAt(0)).forEach(System.out::println);
    }