ExcelUtil uses reflection and POI to read Excel, omitting the tedious steps of reading Excel in the past. It only takes 2 steps to call ExcelUtil. Yes, you read that right, 2 steps are enough to read the content of Excel. Automatic assignment, pass in the path of the corresponding Model, and the value will be automatically assigned. Automatically match data types such as String, Int, Long, Date, Double, etc., and accurately locate error messages.
ExcelUtil usage scenarios
You can imagine that we now have an Excel import task, such as importing a class's student roster. For example, the student entity class is Student.java. A general import requires traversing Excel in each row and column.
Then assign values to various attributes of Student, and then if Teacher is encountered. Java needs to be imported. Do we still need to write the traversal again? The code is smelly and long, and there is a lot of redundancy in the code.
Now with the help of the ExcelUtil public class, elegant and easy reading can be achieved. Compatible with Excel versions 03 and 07. Just introduce maven directly into your project.