@Bean
@Scope(scopeName = "prototype")
@SuppressWarnings("unchecked")
public <ITEM> Grid<ITEM> configureBeanGrid(DependencyDescriptor dependencyDescriptor) {
logger.debug("Configuring Vaadin Grid as bean");
long timestamp = System.currentTimeMillis();
ResolvableType injectionPointType = dependencyDescriptor.getResolvableType();
if (!injectionPointType.hasGenerics()) {
throw new IllegalStateException("Grid injection point is expected to declare a static item type");
}
ResolvableType genericType = injectionPointType.getGeneric();
Class<ITEM> itemType = (Class<ITEM>) genericType.resolve();
logger.debug("Vaadin Grid will use " + itemType.getCanonicalName() + " as item type");
Grid<ITEM> grid = configureGridInstance(itemType);
long configTime = System.currentTimeMillis() - timestamp;
logger.debug("Done configuring Grid for " + itemType.getName() + " in " + configTime + "ms");
return grid;
}
BeanGridConfiguration.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:bean-grid
作者:
评论列表
文章目录