正则校验 @param v 值 @param excelCheck 注解 @param i 行数 @param fieldName excel段名 @param errList 错误信息集合
(Object v, ExcelCheck excelCheck, int i, String fieldName, List<String> errList)
| 147 | * @param errList 错误信息集合 |
| 148 | */ |
| 149 | private static void matches(Object v, ExcelCheck excelCheck, int i, String fieldName, List<String> errList) { |
| 150 | if (ObjectUtil.isNotEmpty(v) && ObjectUtil.isNotEmpty(excelCheck.matches()) |
| 151 | && !Pattern.compile(excelCheck.matches()).matcher(v.toString()).matches()) { |
| 152 | StringBuilder err = new StringBuilder("第").append(i).append("行,").append(fieldName).append("格式不合法;"); |
| 153 | errList.add(err.toString()); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * 时间格式 |
no outgoing calls
no test coverage detected