private static void fillSheetValidation(XSSFSheet sheet, List<Pair<Field, ExcelField>> fieldMetas,
            String className) {
        int bound = fieldMetas.size();
        for (int index = 0; index < bound; index++) {
            Pair<Field, ExcelField> excelFieldPair = fieldMetas.get(index);
            Class<? extends ExcelCellValidator> validator = excelFieldPair.getRight().validator();

            Optional<List<String>> optionalList = Optional.ofNullable(validator)
                    .filter(v -> v != ExcelCellValidator.class)
                    .map(v -> {
                        try {
                            return (ExcelCellValidator<?>) v.newInstance();
                        } catch (InstantiationException | IllegalAccessException e) {
                            LOGGER.error("Can not properly create ExcelCellValidator", e);
                            return null;
                        }
                    })
                    .map(ExcelCellValidator::constraint);
            List<String> valueOfCol = optionalList.orElseGet(Collections::emptyList);
            if (valueOfCol.isEmpty()) {
                continue;
            }
            if (String.join("\n", valueOfCol).length() > CONSTRAINT_MAX_LENGTH) {
                throw new IllegalArgumentException(
                        "field '" + excelFieldPair.getLeft().getName() + "' in class '" + className
                                + "' valid message length must be less than 255 characters");
            }

            CellRangeAddressList regions = new CellRangeAddressList(1, CONSTRAINT_MAX_LENGTH, index, index);
            XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper(sheet);
            XSSFDataValidationConstraint explicitListConstraint = (XSSFDataValidationConstraint) dvHelper
                    .createExplicitListConstraint(valueOfCol.toArray(new String[0]));
            XSSFDataValidation dataValidation =
                    (XSSFDataValidation) dvHelper.createValidation(explicitListConstraint, regions);
            sheet.addValidationData(dataValidation);
        }
    }
Fills the validation constraints for a given sheet based on the provided class and fieldMetas.

@param sheet      the sheet to fill with validation constraints
@param fieldMetas the fieldMetas to use for validation constraints
@param className  the class to use for validation constraints
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/tool/excel/ExcelTool.java