当前位置

网站首页> 程序设计 > 程序资讯 > 软件更新资讯 > 浏览文章

fastexcel v0.0.1 发布,快速简单操作excel小工具

作者:小梦 来源: 网络 时间: 2024-05-06 阅读:

#广州# OSC源创会第31期(12月27日)开始报名,OSC自曝家丑!

FastExcel 能快速简单读取excel数据,将Apache POI进行了薄封装,基于注解,更加易于使用,此版本是第一个版本。

项目地址:

github: https://github.com/sd4324530/fastexcel

osc: http://git.oschina.net/pyinjava/fastexcel

使用样例

FastExcel fastExcel = new FastExcel("E:/data.xlsx");        fastExcel.setSheetName("活动信息数据");        List<MyTest> tests = fastExcel.parse(MyTest.class);        if(null != tests && !tests.isEmpty()) {            for(MyTest myTest : tests) {                LOG.debug("记录:{}", myTest.toString());            }        } else {            LOG.debug("没有结果");        }

映射类:

public class MyTest {    @MapperCell(cellName = "名称")    private String name;    @MapperCell(cellName = "联系电话")    private String phone;    @MapperCell(cellName = "地址")    private String address;    @MapperCell(cellName = "一级分类ID")    private int type;    @MapperCell(cellName = "经度")    private double lat;}