File tree Expand file tree Collapse file tree
wapperInt/wapperRef/sysWppers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99* JavaBean实体支持使用注解添加正则规则校验,HashMap支持数组规则校验
1010* 依赖POI,使用Maven构建
1111
12+ ## 更新纪录
13+ ### 更新2017/01/06
14+ * 整合注解,使用导出和读取使用同一个ExcelAnno注解
15+ * 如果不出意外,最后一次更新
16+
1217## 更新纪录
1318### 更新2017/01/05
1419* 修复据库查询的导出(Object)递归越栈问题
Original file line number Diff line number Diff line change 1- package seven .wapperInt . anno ;
1+ package seven .anno ;
22
33import java .lang .annotation .ElementType ;
44import java .lang .annotation .Retention ;
2929public @interface ExcelAnno {
3030 public String Value ()default "Null" ;
3131 public boolean Pass () default false ;
32- public String Required () default "Null" ;
32+ public String Required () default "Null" ;
33+ public short Align () default 0x2 ;
3334
3435}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1515// (______|______)
1616//=======================================================
1717
18+ import seven .anno .ExcelAnno ;
1819import seven .callBack .PackageDataInterface ;
19- import seven .savewapper .anno .ExcelAnno ;
2020import seven .util .ExcelTool ;
2121
2222import java .lang .reflect .Field ;
@@ -65,8 +65,8 @@ public ResExprotDBObj CreateList() throws Exception {
6565 ExcelAnno anno =null ;
6666 for (int i = 0 ; i < len ; i ++) {
6767 fields [i ].setAccessible (true );
68- if ((anno =fields [i ].getAnnotation (ExcelAnno .class ))!=null ){
69- name [i ]=anno .value ();
68+ if ((anno =fields [i ].getAnnotation (ExcelAnno .class ))!=null &&! anno . Value (). equals ( "Null" ) ){
69+ name [i ]=anno .Value ();
7070 continue ;
7171 }
7272 name [i ]=fields [i ].getName ();
Original file line number Diff line number Diff line change 1616//=======================================================
1717
1818import org .apache .poi .ss .usermodel .*;
19- import seven .savewapper . anno .ExcelAnno ;
19+ import seven .anno .ExcelAnno ;
2020import seven .savewapper .wapperRef .SaveExcelObject ;
2121import seven .util .ExcelTool ;
2222
@@ -56,9 +56,9 @@ public void Save() throws Exception {
5656 continue ;
5757 }
5858 ea = fields [i ].getAnnotation (ExcelAnno .class );
59- if (ea != null ) {
60- title [i ] = ea .value ();
61- align [i ] = ea .align ();
59+ if (ea != null &&! ea . Value (). equals ( "Null" ) ) {
60+ title [i ] = ea .Value ();
61+ align [i ] = ea .Align ();
6262 continue ;
6363 }
6464 title [i ] = fields [i ].getName ();
Original file line number Diff line number Diff line change 44import org .apache .poi .ss .usermodel .Sheet ;
55import org .apache .poi .ss .usermodel .Workbook ;
66import seven .util .ExcelTool ;
7- import seven .wapperInt . anno .ExcelAnno ;
7+ import seven .anno .ExcelAnno ;
88import seven .util .RegHelper ;
99import seven .wapperInt .wapperRef .WrapperObj ;
1010
You can’t perform that action at this time.
0 commit comments