featzhang commented on code in PR #7869:
URL: https://github.com/apache/inlong/pull/7869#discussion_r1168568103


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/tool/excel/ExcelTool.java:
##########
@@ -553,17 +599,22 @@ public static <T> ClassMeta<T> of(Class<T> clazz)
             for (Field field : fields) {
                 ExcelField excelField = field.getAnnotation(ExcelField.class);
                 if (excelField != null) {
+                    Class<? extends ExcelCellValidator> validatorClass = 
excelField.validator();
                     ExcelCellDataTransfer excelCellDataTransfer = 
excelField.x2oTransfer();
+                    ExcelCellValidator excelCellValidator = null;
+                    if (validatorClass != ExcelCellValidator.class) {
+                        excelCellValidator = validatorClass.newInstance();
+                    }
                     meta.addField(field.getName(), excelField.name(), field, 
field.getType(),
-                            excelCellDataTransfer);
+                            excelCellDataTransfer, excelCellValidator);

Review Comment:
   The ExcelCellValidator has no effect when it is null, and it will check if 
it is null when used.



-- 
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