TemplateExportParams.java
4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
package com.bckefu.excel.entity;
import com.bckefu.excel.export.style.ExcelExportStylerDefaultImpl;
/**
* 模板导出参数设置
*
* @author caoliang1918@aliyun.com
* @Date 2017/11/5:23:41
*/
public class TemplateExportParams extends ExcelBaseParams {
/**
* 输出全部的sheet
*/
private boolean scanAllsheet = false;
/**
* 模板的路径
*/
private String templateUrl;
/**
* 需要导出的第几个 sheetNum,默认是第0个
*/
private Integer[] sheetNum = new Integer[]{0};
/**
* 设置sheetName 不填就使用原来的
*/
private String[] sheetName;
/**
* 表格列标题行数,默认1
*/
private int headingRows = 1;
/**
* 表格列标题开始行,默认1
*/
private int headingStartRow = 1;
/**
* 设置数据源的NUM
*/
private int dataSheetNum = 0;
/**
* Excel 导出style
*/
private Class<?> style = ExcelExportStylerDefaultImpl.class;
/**
* FOR EACH 用到的局部变量
*/
private String tempParams = "t";
private boolean colForEach = false;
/**
* 默认构造器
*/
public TemplateExportParams() {
}
/**
* 构造器
*
* @param templateUrl 模板路径
* @param scanAllsheet 是否输出全部的sheet
* @param sheetName sheet的名称,可不填
*/
public TemplateExportParams(String templateUrl, boolean scanAllsheet, String... sheetName) {
this.templateUrl = templateUrl;
this.scanAllsheet = scanAllsheet;
if (sheetName != null && sheetName.length > 0) {
this.sheetName = sheetName;
}
}
/**
* 构造器
*
* @param templateUrl 模板路径
* @param sheetNum sheet 的位置,可不填
*/
public TemplateExportParams(String templateUrl, Integer... sheetNum) {
this.templateUrl = templateUrl;
if (sheetNum != null && sheetNum.length > 0) {
this.sheetNum = sheetNum;
}
}
/**
* 单个sheet输出构造器
*
* @param templateUrl 模板路径
* @param sheetName sheet的名称
* @param sheetNum sheet的位置,可不填
*/
public TemplateExportParams(String templateUrl, String sheetName, Integer... sheetNum) {
this.templateUrl = templateUrl;
this.sheetName = new String[]{sheetName};
if (sheetNum != null && sheetNum.length > 0) {
this.sheetNum = sheetNum;
}
}
public int getHeadingRows() {
return headingRows;
}
public int getHeadingStartRow() {
return headingStartRow;
}
public String[] getSheetName() {
return sheetName;
}
public Integer[] getSheetNum() {
return sheetNum;
}
public String getTemplateUrl() {
return templateUrl;
}
public void setHeadingRows(int headingRows) {
this.headingRows = headingRows;
}
public void setHeadingStartRow(int headingStartRow) {
this.headingStartRow = headingStartRow;
}
public void setSheetName(String[] sheetName) {
this.sheetName = sheetName;
}
public void setSheetName(String sheetName) {
this.sheetName = new String[]{sheetName};
}
public void setSheetNum(Integer[] sheetNum) {
this.sheetNum = sheetNum;
}
public void setSheetNum(Integer sheetNum) {
this.sheetNum = new Integer[]{sheetNum};
}
public void setTemplateUrl(String templateUrl) {
this.templateUrl = templateUrl;
}
public Class<?> getStyle() {
return style;
}
public void setStyle(Class<?> style) {
this.style = style;
}
public int getDataSheetNum() {
return dataSheetNum;
}
public void setDataSheetNum(int dataSheetNum) {
this.dataSheetNum = dataSheetNum;
}
public boolean isScanAllsheet() {
return scanAllsheet;
}
public void setScanAllsheet(boolean scanAllsheet) {
this.scanAllsheet = scanAllsheet;
}
public String getTempParams() {
return tempParams;
}
public void setTempParams(String tempParams) {
this.tempParams = tempParams;
}
public boolean isColForEach() {
return colForEach;
}
public void setColForEach(boolean colForEach) {
this.colForEach = colForEach;
}
}