Simple lib to read a xls file and load a list of java objects and vice-versa. Was developed to have zero configuration and just for pojos.
- I want a simple lib to read/write my objects to xls file. (Apache POI under the hood)
- I want it zero configuration. (Uses reflection)
- I don't care if it has no flexibility and plugins or hooks.
To read:
Excel excel = new Excel("TestCaseData.xls");
List<Case> results = excel.read(myClass.class.getName(), sheetName);
excel.close();
To write:
Excel excel = new Excel("Path to my file.xls");
excel.write(myList);
excel.close();
Example from [Excel test class (https://github.com/rafaelvanat/ExcelPojos/blob/master/src/tests/com/stinted/excel/test/ExcelTest.java)]
To install this in your maven, first succesfully build it your machine, then:
mvn install:install-file -Dfile=<path to jar> -DgroupId="com.stinted.excel"
-DartifactId="excelPojo" -Dversion="1.0-SNAPSHOT" -Dpackaging=jar
OR
mvn install:install-file -Dfile=<path to jar> -DpomFile=<path to POM>
Finally, add this to your pom:
<dependency>
<groupId>com.stinted.excel</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>excelPojo</artifactId>
</dependency>
ExcelPojos is Apache 2.0 licensed.