org.nutz.ioc.Ioc.getNamesByAnnotation()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.nutz.ioc.Ioc.getNamesByAnnotation()方法的一些代码示例,展示了Ioc.getNamesByAnnotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ioc.getNamesByAnnotation()方法的具体详情如下:
包路径:org.nutz.ioc.Ioc
类名称:Ioc
方法名:getNamesByAnnotation

Ioc.getNamesByAnnotation介绍

暂无

代码示例

代码示例来源:origin: nutzam/nutzboot

/**
 * 容器初始化时,初始化Spring Mvc的Ioc容器,并放入ServletContext
 */
public void contextInitialized(ServletContextEvent sce) {
  applicationContext = new XmlWebApplicationContext();
  applicationContext.setServletContext(sce.getServletContext());
  applicationContext.setConfigLocation(configLocation);
  applicationContext.refresh();
  appContext.getComboIocLoader().addLoader(new SpringIocLoader2(applicationContext, getSpringBeanNames().toArray(new String[0])));
  sce.getServletContext().setAttribute("spring." + selfName, applicationContext);
  // 登记所有标注了@AsSpringBean的对象到spring ioc
  Ioc ioc = appContext.getIoc();
  for (String name : ioc.getNamesByAnnotation(AsSpringBean.class)) {
    applicationContext.getBeanFactory().registerSingleton(name, ioc.get(null, name));
  }
}

代码示例来源:origin: nutzam/nutzboot

String[] names = appContext.getIoc().getNamesByAnnotation(ActionBean.class);
BuiltInActionLibraryBuilder builder = applicationContext.getBean(BuiltInActionLibraryBuilder.class);
Method method = BuiltInActionLibraryBuilder.class.getDeclaredMethod("buildMethod", Method[].class);

相关文章