private static boolean isString(Object value) {
return value instanceof String;
}
/*package*/ static DataValidation validate(Worksheet sheet, int row, int col, Object value, int cellType) {
DataValidation dv = sheet.getDataValidation(row, col);
//no validation constraint
if (dv == null) {
return null;
}
final DataValidationConstraint constraint = dv.getValidationConstraint();
//allow any value => no need to do validation
if (constraint.getValidationType() == ValidationType.ANY) { //can be any value, meaning no validation
return null;
}
//ignore empty and value is empty
if (value == null || (value instanceof String && ((String)value).length() == 0)) {
if (dv.getEmptyCellAllowed()) {
return null;
}
}
//get new evaluated formula value
if (cellType == Cell.CELL_TYPE_FORMULA) {