Search in sources :

Example 1 with ValidResult

use of com.github.lybgeek.validator.model.ValidResult in project springboot-learning by lyb-geek.

the class BaseAnalysisEventListener method validatePass.

private boolean validatePass(T entity, AnalysisContext analysisContext) {
    ValidResult validResult = ValidatorUtils.allCheckValidate(entity, false, ExcelGroup.class);
    if (!validResult.isSuccess()) {
        String errorMsg = StringUtils.join(validResult.getErrorMessages(), ",");
        ErrorExcelRow errorExcelRow = this.setAndReturnErrorExcelRow(analysisContext, errorMsg);
        errorExcelRows.add(errorExcelRow);
    }
    return validResult.isSuccess();
}
Also used : ErrorExcelRow(com.github.lybgeek.excel.entity.ErrorExcelRow) ValidResult(com.github.lybgeek.validator.model.ValidResult)

Aggregations

ErrorExcelRow (com.github.lybgeek.excel.entity.ErrorExcelRow)1 ValidResult (com.github.lybgeek.validator.model.ValidResult)1