注释接口 ExcelColumn
@Retention(RUNTIME)
@Target({FIELD,METHOD,TYPE})
@Repeatable(ExcelColumns.class)
public @interface ExcelColumn
定义导出Excel数据列的配置注解
- 作者:
- guyadong
-
嵌套类概要
嵌套类修饰符和类型类说明static enumstatic enumstatic enum -
可选元素概要
可选元素修饰符和类型可选元素说明String[]自定义数据处理器参数导出类型(0数字 1字符串)导出字体颜色,参见IndexedColors对象(Java Bean/Map/JSON)中的字段名.String[]设置只能选择不能输入的列内容.日期格式, 如: yyyy-MM-dd当值为空时,字段的默认值boolean是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.单元格填充颜色,参见IndexedColorsClass<?>自定义数据处理器double导出时在excel中每个列的高度 单位为字符导出字段水平对齐方式,参见HorizontalAlignment默认整数(Integer,Long,Short)格式导出到Excel中的名字.为空则与columnName()相等提示信息读取内容转表达式 (如: 0=男,1=女,2=未知,*=错误值), '*'为匹配其他未定义值的表达式指定字段读取方法名intBigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVENintBigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)分隔符,读取字符串组内容int导出时在excel中排序boolean是否自动统计数据,在最后追加一行统计数据总和文字后缀,如% 90 变成90%另一个类中的属性名称,支持多级获取,以小数点隔开字段类型(0:导出导入;1:仅导出;2:仅导入)double导出时在excel中每个列的宽 单位为字符指定字段写入方法名
-
元素详细资料
-
sort
int sort导出时在excel中排序- 默认值:
2147483647
-
columnName
String columnName对象(Java Bean/Map/JSON)中的字段名.- 默认值:
""
-
name
String name导出到Excel中的名字.为空则与columnName()相等- 默认值:
""
-
integralFormat
String integralFormat默认整数(Integer,Long,Short)格式- 默认值:
""
-
dateFormat
String dateFormat日期格式, 如: yyyy-MM-dd- 默认值:
""
-
readConverterExp
String readConverterExp读取内容转表达式 (如: 0=男,1=女,2=未知,*=错误值), '*'为匹配其他未定义值的表达式- 默认值:
""
-
separator
String separator分隔符,读取字符串组内容- 默认值:
","
-
scale
int scaleBigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)- 默认值:
-1
-
roundingMode
int roundingModeBigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN- 默认值:
6
-
height
double height导出时在excel中每个列的高度 单位为字符- 默认值:
14.0
-
width
double width导出时在excel中每个列的宽 单位为字符- 默认值:
0.0
-
suffix
String suffix文字后缀,如% 90 变成90%- 默认值:
""
-
defaultValue
String defaultValue当值为空时,字段的默认值- 默认值:
""
-
prompt
String prompt提示信息- 默认值:
""
-
combo
String[] combo设置只能选择不能输入的列内容.- 默认值:
{}
-
export
boolean export是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.- 默认值:
true
-
targetAttr
String targetAttr另一个类中的属性名称,支持多级获取,以小数点隔开- 默认值:
""
-
statistics
boolean statistics是否自动统计数据,在最后追加一行统计数据总和- 默认值:
false
-
cellType
ExcelColumn.ColumnType cellType导出类型(0数字 1字符串)- 默认值:
STRING
-
color
String color导出字体颜色,参见IndexedColors- 默认值:
""
-
fillColor
String fillColor单元格填充颜色,参见IndexedColors- 默认值:
""
-
horizontalAlign
String horizontalAlign导出字段水平对齐方式,参见HorizontalAlignment- 默认值:
""
-
handler
Class<?> handler自定义数据处理器- 默认值:
gu.sql2java.excel.annotations.ExcelHandlerAdapter.class
-
args
String[] args自定义数据处理器参数- 默认值:
{}
-
readMethod
String readMethod指定字段读取方法名- 默认值:
""
-
writeMethod
String writeMethod指定字段写入方法名- 默认值:
""
-
type
ExcelColumn.Type type字段类型(0:导出导入;1:仅导出;2:仅导入)- 默认值:
ALL
-