我为此使用了univocity-parser库
类人{
@Parsed(索引=1)
字符串名称;
@Parsed(索引=2)
字符串年龄;
地址地址;
}
班级地址{
@Parsed(索引=3)
弦街;
串城;
}
BeanListProcessor rowProcessor = new BeanListProcessor(Person.class);
列出 bean = rowProcessor.getBeans();
将 csv 列映射到 POJO 类时出现异常:com.univocity.parsers.common.DataProcessingException:无法将值设置为地址字段
有没有其他方法可以做到