org.jboss.weld.environment.se.Weld.addExtensions()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(93)

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

Weld.addExtensions介绍

[英]Attempts to initialize the classes as extensions and add them to the set of extensions.
[中]尝试将类初始化为扩展,并将它们添加到扩展集中。

代码示例

代码示例来源:origin: org.jboss.weld/weld-junit5

/**
 * Create a builder instance.
 *
 * @param weld
 * @return a builder instance
 * @see #of(Class...)
 */
@SuppressWarnings("unchecked")
public static Builder from(Class<?>... beanClasses) {
  Weld weld = createWeld();
  for (Class<?> clazz : beanClasses) {
    if (Extension.class.isAssignableFrom(clazz)) {
      weld.addExtensions((Class<? extends Extension>) clazz);
    } else {
      weld.addBeanClass(clazz);
    }
  }
  return from(weld);
}

代码示例来源:origin: weld/weld-junit

/**
 * Create a builder instance.
 *
 * @param weld
 * @return a builder instance
 * @see #of(Class...)
 */
public static Builder from(Class<?>... beanClasses) {
  Weld weld = createWeld();
  for (Class<?> clazz : beanClasses) {
    if (Extension.class.isAssignableFrom(clazz)) {
      weld.addExtensions((Class<? extends Extension>) clazz);
    } else {
      weld.addBeanClass(clazz);
    }
  }
  return from(weld);
}

代码示例来源:origin: weld/weld-junit

/**
 * Create a builder instance.
 *
 * @param weld
 * @return a builder instance
 * @see #of(Class...)
 */
@SuppressWarnings("unchecked")
public static Builder from(Class<?>... beanClasses) {
  Weld weld = createWeld();
  for (Class<?> clazz : beanClasses) {
    if (Extension.class.isAssignableFrom(clazz)) {
      weld.addExtensions((Class<? extends Extension>) clazz);
    } else {
      weld.addBeanClass(clazz);
    }
  }
  return from(weld);
}

代码示例来源:origin: jbosstm/narayana

Weld weld = new Weld()
  .disableDiscovery()
  .addExtensions(LraAnnotationProcessingExtension.class)
  .setClassLoader(classLoader)
  .addBeanClasses(clazzNames.toArray(new Class[clazzNames.size()]));

相关文章