标签:
下面是一段简单的示例配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:excelbatis="http://www.taobao.com/excelbatis/orm"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.taobao.com/excelbatis/orm http://www.taobao.com/excelbatis/orm.xsd"
default-autowire="byName">
<excelbatis:processor id="processor" readEntityType="com.excel.orm.demo.PersonInfo">
<excelbatis:columnAttrs>
<excelbatis:columnAttr columnName="name" columnField="name"/>
<excelbatis:columnAttr columnName="age" columnField="age"/>
<excelbatis:columnAttr columnName="birthday" columnField="birthday" builtInConvertor="dateConvertor"/>
</excelbatis:columnAttrs>
</excelbatis:processor>
</beans>
下面分成几步来说:
xmlns:excelbatis="http://www.taobao.com/excelbatis/orm"
http://www.taobao.com/excelbatis/orm http://www.taobao.com/excelbatis/orm.xsd
<excelbatis:processor id="processor" readEntityType="com.excel.orm.demo.PersonInfo">
配置每一列:
依赖你前面定义的processor的bean然后调用com.excel.orm.processor.ExcelBatisProcessor#parse方法来解析excel文件到实体List,调用com.excel.orm.processor.ExcelBatisProcessor#write方法将实体列表写入excel文件
Excelbatis-一个将excel文件读入成实体列表、将实体列表解析成excel文件的ORM框架,简洁易于配置、可扩展性好
标签:
原文地址:http://www.cnblogs.com/developerY/p/4565330.html