-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExcelColumn.java
82 lines (71 loc) · 1.85 KB
/
ExcelColumn.java
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
package cn.fencer911;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 数值型的栏位只能使用Double
* @author https://github.com/fencer911/ExcelColumnUtil
* @version 1.0, Created at 2020年2月20日
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ExcelColumn {
/**
* 顺序 default 100
*
* @return index
*/
String value();
/**
* 当值为null时要显示的值 default StringUtils.EMPTY
*
* @return defaultValue
*/
String defaultValue() default "";
/**
* 用于验证
*
* @return valid
*/
Valid valid() default @Valid();
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface Valid {
/**
* 必须与in中String相符,目前仅支持String类型
*
* @return e.g. {"key","value"}
*/
String[] in() default {};
/**
* 是否允许为空,用于验证数据 default true
*
* @return allowNull
*/
boolean allowNull() default false;
/**
* Apply a "greater than" constraint to the named property
*
* @return gt
*/
double gt() default Double.NaN;
/**
* Apply a "less than" constraint to the named property
* @return lt
*/
double lt() default Double.NaN;
/**
* Apply a "greater than or equal" constraint to the named property
*
* @return ge
*/
double ge() default Double.NaN;
/**
* Apply a "less than or equal" constraint to the named property
*
* @return le
*/
double le() default Double.NaN;
}
}