MCPcopy Index your code
hub / github.com/Bit0r/java-util / matches

Method matches

src/main/java/util/ExcelUtils.java:149–155  ·  view source on GitHub ↗

正则校验 @param v 值 @param excelCheck 注解 @param i 行数 @param fieldName excel段名 @param errList 错误信息集合

(Object v, ExcelCheck excelCheck, int i, String fieldName, List<String> errList)

Source from the content-addressed store, hash-verified

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 * 时间格式

Callers 4

excelCheckObjMethod · 0.95
isNumericMethod · 0.80
isNumericMethod · 0.80
matchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected