如果返回null则表示没有错误 通过实体中注解 必填校验 @param objectList @return
(List objectList)
| 339 | * @return |
| 340 | */ |
| 341 | public static String check(List objectList) { |
| 342 | if (null == objectList || objectList.size() < 1) { |
| 343 | return "参数为空"; |
| 344 | } |
| 345 | StringBuilder sb = new StringBuilder(); |
| 346 | for (int i = 0; i < objectList.size(); i++) { |
| 347 | Object date = objectList.get(i); |
| 348 | String res = check(date); |
| 349 | if (res != null) { |
| 350 | sb.append("第" + i + "列数据:").append(res).append("."); |
| 351 | } |
| 352 | } |
| 353 | if (sb.length() > 0 && !"null".equals(sb.toString()) && !"".equals(sb.toString())) { |
| 354 | return sb.toString(); |
| 355 | } |
| 356 | return null; |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * 如果返回null则表示没有错误 |
nothing calls this directly
no outgoing calls
no test coverage detected