fuweng11 commented on code in PR #7819:
URL: https://github.com/apache/inlong/pull/7819#discussion_r1162466726


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/tool/excel/ExcelTool.java:
##########
@@ -159,6 +168,59 @@ private static void fillSheetHeader(XSSFRow row, 
List<String> heads) {
             cell.setCellValue(new XSSFRichTextString(heads.get(index)));
         });
     }
+    /**
+     * Fills the validation constraints for a given sheet based on the 
provided class and fields.
+     *
+     * @param clazz  the class to use for validation constraints
+     * @param sheet  the sheet to fill with validation constraints
+     * @param fields the fields to use for validation constraints
+     */
+    private static <T> void fillSheetValidation(Class<T> clazz, XSSFSheet 
sheet, Field[] fields) {
+        List<Pair<String, ExcelField>> excelFields = new ArrayList<>();
+
+        for (Field field : fields) {
+            field.setAccessible(true);
+            ExcelField excelField = field.getAnnotation(ExcelField.class);
+            if (excelField != null) {
+                excelFields.add(Pair.of(field.getName(), excelField));
+            }
+        }
+
+        int bound = excelFields.size();
+        for (int index = 0; index < bound; index++) {
+            Pair<String, ExcelField> excelFieldPair = excelFields.get(index);
+            Class<? extends ExcelCellValidator> validator = 
excelFieldPair.getRight().validator();
+
+            Optional<List<String>> optionalList = 
Optional.ofNullable(validator)
+                    .filter(v -> v != ExcelCellValidator.class)

Review Comment:
   Is this statement valid?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to