8
触发Bug的代码
@Data
static class Humen{
@ExcelProperty("名字")
private String name;
}
@Data
static
class Man extends Humen{
@ExcelProperty("地址")
private String addr;
}
public static void main(String[] args) throws FileNotFoundException {
Man man = new Man();
man.setAddr("武汉");
man.setName("张三");
ExcelWriter excelWriter = EasyExcel.write(new FileOutputStream(new File("/Users/yuangong/aaa.xlsx")), Humen.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("test").build();
excelWriter.write(Collections.singletonList(man), writeSheet);
// 千万别忘记finish 会帮忙关闭流
excelWriter.finish();
}
提示的异常或者没有达到的效果