me.excel.tools.validator.cell.NumberValidator 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.math.NumberUtils;
/**
* number validator
*
* Created by hanwen on 16/7/7.
*/
public class NumberValidator extends CellValidatorAdapter {
public NumberValidator(String matchField) {
super(matchField, "应该为数字");
}
public NumberValidator(String matchField, String message) {
super(matchField, message);
}
@Override
protected boolean customValidate(ExcelCell excelCell) {
return NumberUtils.isNumber(excelCell.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy