我使用以下cglib代码创建了一个类。
public static Class<?> createBeanClass (final String className, final map<String, Class<?>> properties) {
final BeanGenerator bg = new BeanGenerator();
bg.addProperties(bg, properties);
return (Class<?>) bg.createClass();
}
The class is created here.
Map<String, Class<?>> properties = new LinkedHashMap<String, Class<?>>();
List<String> headers = getHeader();
for(String hdr : headers) {
properties.put(hdr, String.class);
}
final Class<?> beanClass = createBeanClass(ReturnObject, properties);
在那之后,现在我想做下面的事情,
List beanClassList = new ArrayList <>();