0
版本:3.3.2 问题1: 编译器源码报错 问题2: 我动态生成了一个实体类,代码如下:
private Class<?> createDynamicClass(List<ArchiveField> archiveFields) {
DynamicType.Builder<Object> builder = new ByteBuddy()
.subclass(Object.class)
.name("DynamicExcelEntity");
for (ArchiveField field : archiveFields) {
String fieldName = field.getFieldName();
String fieldComment = field.getFieldComment();
Class<?> fieldType = String.class;
builder = builder.defineField(fieldName, fieldType, Visibility.PUBLIC)
.annotateField(AnnotationDescription.Builder.ofType(ExcelProperty.class)
.defineArray("value", new String[]{fieldComment})
.build());
}
return builder.make()
.load(getClass().getClassLoader())
.getLoaded();
}
在dataMap.put(fieldName, value);这一步一直put不进去.dataMap大小一直为0,断点如下动画所示