me.excel.tools.validator.cell.BooleanValidator 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 static me.excel.tools.BooleanTranslator.isValidFalse;
import static me.excel.tools.BooleanTranslator.isValidTrue;
/**
* boolean validator
*
* Created by hanwen on 15-12-18.
*/
public class BooleanValidator extends CellValidatorAdapter {
public BooleanValidator(String matchField) {
super(matchField, "格式应为: \'是\':true,t,是,yes,y,1; \'否\':false,f,否,no,n,0");
}
public BooleanValidator(String matchField, String errorMessage) {
super(matchField, errorMessage);
}
@Override
protected boolean customValidate(ExcelCell excelCell) {
return isValidTrue(excelCell.getValue()) || isValidFalse(excelCell.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy