com.github.willtong:excel4j

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

com.github.willtong
ArtifactId

ArtifactId

excel4j
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.willtong:excel4j
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

https://github.com/WillTong/excel4j
Source Code Management

Source Code Management

https://github.com/WillTong/excel4j

Download excel4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.willtong/excel4j/ -->
<dependency>
    <groupId>com.github.willtong</groupId>
    <artifactId>excel4j</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.willtong/excel4j/
implementation 'com.github.willtong:excel4j:1.0.1'
// https://jarcasting.com/artifacts/com.github.willtong/excel4j/
implementation ("com.github.willtong:excel4j:1.0.1")
'com.github.willtong:excel4j:jar:1.0.1'
<dependency org="com.github.willtong" name="excel4j" rev="1.0.1">
  <artifact name="excel4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.willtong', module='excel4j', version='1.0.1')
)
libraryDependencies += "com.github.willtong" % "excel4j" % "1.0.1"
[com.github.willtong/excel4j "1.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.poi : poi jar 3.16
org.apache.poi : poi-ooxml jar 3.16

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

excel4j

Build Status codecov Dependency Status License

A java library for reading and writing microsoft office excel file.Thanks to POI.

Getting started

  • Define an entity
@Excel
@Sheet("example")
public class Example {
    @Cell("testing string")
    private String paramStr;
    @Cell("testing number")
    private Integer paramInt;
    @Cell(value="testing date",dateFormat="yyyy-MM-dd")
    private Date date;
}
  • list to xls
public class Export {
    public void export(){
        List<Example> list=new ArrayList();
        FileOutputStream fout = new FileOutputStream("/test.xls");
        fout.write(Excel4j.opsWrite().fromList(list));
        fout.close();
    }
}
  • xls to list
public class Export {
    public void export(){
        byte[] data=new byte[1];
        List<Example> list = Excel4j.opsRead(data)
        .toList(Example.class);
    }
}

Versions

Version
1.0.1