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

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

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

Ioc.getNamesByAnnotation介绍

暂无

代码示例

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

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

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

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

相关文章