1 Star 0 Fork 0

半月 / ObjectToFile

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

ObjectToExcel

  • Bean对象与Excel文件相互转换, 依赖配置文件:
 <bean class="org.yong.ObjectToFile.User" skipIndex="1">
     <cell name="name"               title="姓名"/><!-- java.lang.String -->
     <cell name="birthday"           title="生日"/><!-- java.util.Date -->
     <cell name="gender"             title="性别"/><!-- enum -->
     <cell name="phone"              title="联系电话"/>
     <cell name="address.country"    title="国家"/><!--  复杂对象使用OGNL表达式导航, 必须有无参构造函数 -->
     <cell name="address.street"     title="街道"/>
     <cell name="address.admin.name" title="街道管理员"/>
 </bean>
  • 快速使用
File xmlConf = new File("src\\test\\resource\\toXlsx.xml");
// 获取转换器实例
ObjectToFile<User> converter = new ObjectToExcel<User>(xmlConf);
File file = new File("src\\test\\resource\\user.xlsx");
// 解析Excel文件
List<User> beans = converter.toBeans(file);
System.out.println(beans);
// 导出Excel文件
File export = converter.toFile(beans, "src\\test\\resource\\export.xlsx");
System.out.println(export.getAbsolutePath());

Comments ( 0 )

Sign in for post a comment

About

Java对象与文件转换工具 spread retract
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
1
https://git.oschina.net/osby/ObjectToFile.git
git@git.oschina.net:osby/ObjectToFile.git
osby
ObjectToFile
ObjectToFile
master

Search