ExcelReader

Introduction

Encapsulation for reading Excel content. By constructing an ExcelReader object, specifying the Excel file, stream or workbook to be read, and then calling the readXXX method to read the content into the specified format.

Usage

  1. Read all rows and columns in Excel, represented by lists
ExcelReader reader = ExcelUtil.getReader("d:/aaa.xlsx");
List<List<Object>> readAll = reader.read();
  1. Read as a list of Maps, with the first row as the title row by default. The key in the Map is the title, and the value is the cell value corresponding to the title.
ExcelReader reader = ExcelUtil.getReader("d:/aaa.xlsx");
List<Map<String,Object>> readAll = reader.readAll();
  1. Read as a list of Beans, with the field names in the Bean as the titles, and the field values as the cell values corresponding to the titles.
ExcelReader reader = ExcelUtil.getReader("d:/aaa.xlsx");
List<Person> all = reader.readAll(Person.class);