Giter VIP home page Giter VIP logo

oem's Introduction

oem

This is a tool for excel mapping to pojo

很早之前写的一个将excel 转换成对象的工具包,转换成maven了

使用说明(现在支持excel 2007+):

ExcelToObjectByPoi reader=new ExcelToObjectByPoi(ExcelToObjectTest.class.getResource("/"));  

@Test
public void testReadExcel() throws InvalidFormatException, IOException {
	File excelFile = new File(ExcelToObjectTest.class.getResource("/test.xlsx").getFile());
	Workbook workbook = WorkbookFactory.create(excelFile);
	List<User> users = reader.readSheet(workbook.getSheetAt(0), User.class);
	System.out.println(users);
}

默认使用pojo的顺序进行解析,如果有特殊要求,可以这样配置

<?xml version="1.0" encoding="UTF-8"?>
<oem>
        <class name="org.github.oem.pojo.User">
                <property name="id" type="Integer" colIndex="0"></property>
                <property name="name" type="String" colIndex="2"></property>
        </class>
</oem>

oem's People

Contributors

hongliuliao avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.