me.excel.tools.validator.cell.RequireValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-excel-tools Show documentation
Show all versions of java-excel-tools Show documentation
powerful and convenient excel tools
The newest version!
package me.excel.tools.validator.cell;
import me.excel.tools.model.excel.ExcelCell;
import org.apache.commons.lang3.StringUtils;
/**
* required validator
*
* Created by hanwen on 15-12-16.
*/
public class RequireValidator extends CellValidatorAdapter {
public RequireValidator(String matchField) {
super(matchField, "应该为必填");
}
public RequireValidator(String matchField, String errorMessage) {
super(matchField, errorMessage);
}
@Override
public boolean validate(ExcelCell excelCell) {
return customValidate(excelCell);
}
@Override
protected boolean customValidate(ExcelCell excelCell) {
return StringUtils.isNotBlank(excelCell.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy