public static <E> List<E> read(InputStream is, Class<E> clazz)
            throws IOException, IllegalAccessException, InstantiationException, NoSuchMethodException {
        ClassMeta<E> classMeta = ClassMeta.of(clazz);
        int fieldCount = classMeta.fieldCount();

        expectTrue(fieldCount > 0, "The class contains at least one field with a @ExcelField annotation");
        XSSFWorkbook hssfWorkbook = new XSSFWorkbook(is);
        List<E> result = new LinkedList<>();
        for (int sheetIndex = 0; sheetIndex < hssfWorkbook.getNumberOfSheets(); ++sheetIndex) {
            XSSFSheet sheet = hssfWorkbook.getSheetAt(sheetIndex);
            if (sheet != null) {
                XSSFRow headerRow = sheet.getRow(0);
                // According to the name of the header row, determine the column
                for (int colIndex = 0; colIndex < fieldCount + 10 && !classMeta.matchedAll(); colIndex++) {
                    XSSFCell cell = headerRow.getCell(colIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
                    if (cell != null) {
                        classMeta.setFieldLocation(cell.getStringCellValue(), colIndex);
                    }
                }
                expectTrue(classMeta.matchedAll(),
                        "The first line field must be the same number of @ExcelMeta annotated fields in the class");

                int lastRowNum = sheet.getLastRowNum();
                List<E> currentResult = new ArrayList<>(lastRowNum);
                List<String> validateResult = new ArrayList<>(lastRowNum);
                for (int rowNum = 1; rowNum <= lastRowNum; ++rowNum) {
                    XSSFRow row = sheet.getRow(rowNum);
                    if (row == null) {
                        continue;
                    }
                    // Mark the row only if all cells are not null
                    Map<Integer, FieldMeta> positionFieldMetaMap = classMeta.positionFieldMetaMap;
                    boolean rowNotNull = positionFieldMetaMap.keySet()
                            .stream()
                            .map(colIndex -> row.getCell(colIndex,
                                    Row.MissingCellPolicy.RETURN_BLANK_AS_NULL) != null)
                            .reduce(false, (left, right) -> left || right);

                    // Skip if all columns are null
                    if (!rowNotNull) {
                        continue;
                    }

                    E instance = null;
                    StringBuilder colValidateResult = new StringBuilder();
                    boolean hasValueInRow = false;
                    for (Map.Entry<Integer, FieldMeta> entry : positionFieldMetaMap.entrySet()) {
                        Integer colIndex = entry.getKey();
                        FieldMeta fieldMeta = entry.getValue();
                        XSSFCell cell = row.getCell(colIndex, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);

                        hasValueInRow = true;
                        ExcelCellDataTransfer cellDataTransfer = fieldMeta.getCellDataTransfer();
                        Object value = parseCellValue(cellDataTransfer, cell);
                        if (instance == null) {
                            instance = clazz.newInstance();
                        }
                        validateCellValue(fieldMeta, value).ifPresent(info -> colValidateResult.append("Column ")
                                .append(colIndex + 1).append(":").append(info).append(";"));
                        fieldMeta.getField().setAccessible(true);
                        fieldMeta.getField().set(instance, value);
                    }
                    if (hasValueInRow) {
                        currentResult.add(instance);
                    }
                    if (colValidateResult.length() > 0) {
                        String lineValidateResult =
                                String.format("Error in Row: %d, %s", (rowNum + 1), colValidateResult);
                        validateResult.add(lineValidateResult);
                    }
                }
                Preconditions.expectEmpty(validateResult, ErrorCodeEnum.INVALID_PARAMETER,
                        String.join("\n", validateResult));
                result.addAll(currentResult);
            }
        }
        return result;
    }
Read data from an Excel file and convert it to a list of objects of the specified class.

@param is    The input stream of the Excel file.
@param clazz The class of the objects to be converted.
@param <E>   The type of the objects to be converted.
@return A list of objects of the specified class.
@throws IOException            If an I/O error occurs.
@throws IllegalAccessException If the class or its nullable constructor is not accessible.
@throws InstantiationException If the class that declares the underlying field is an interface or is abstract.
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/tool/excel/ExcelTool.java