List<Object> objects = ExcelUtil.readExcel(file, new ImportExcelInfo());
例如改objects中有如下值:
想要取出来deviceNo需要BeanUtils类
for (Object obj : objects) {
Map<String, String> obMap = BeanUtils.describe(obj);
String deviceNo = obMap.get("deviceNo");
}
在pom.xml中引入:
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>