javax.enterprise.inject.spi.Bean.getStereotypes()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(143)

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

Bean.getStereotypes介绍

[英]Returns bean stereotypes.
[中]返回bean原型。

代码示例

代码示例来源:origin: com.caucho/resin

/**
 * Returns the bean's deployment type
 */
@Override
public Set<Class<? extends Annotation>> getStereotypes()
{
 return _bean.getStereotypes();
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

@Override
public Set<Class<? extends Annotation>> getStereotypes()
{
  return bean.getStereotypes();
}

代码示例来源:origin: apache/deltaspike

@Override
public Set<Class<? extends Annotation>> getStereotypes()
{
  return producer.getStereotypes();
}

代码示例来源:origin: caelum/vraptor4

private Annotation tryToFindAStereotypeQualifier(Bean<?> bean) {
  for (Class<? extends Annotation> annotation : bean.getStereotypes()) {
    if (STEREOTYPES.containsKey(annotation)) {
      return STEREOTYPES.get(annotation);
    }
  }
  return null;
}

代码示例来源:origin: com.caucho/resin

@Override
public Set<Class<? extends Annotation>> getStereotypes()
{
 return getBean().getStereotypes();
}

代码示例来源:origin: weld/core

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

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

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

代码示例来源:origin: weld/core

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

代码示例来源:origin: weld/core

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

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

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

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

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

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

static Set<Bean<?>> findAlternativeStereotypeBeans(Class<? extends Annotation> stereotype, Probe probe) {
  Set<Bean<?>> beans = new HashSet<Bean<?>>();
  for (Bean<?> bean : probe.getBeans()) {
    if (bean.isAlternative() && bean.getStereotypes().contains(stereotype)) {
      beans.add(bean);
    }
  }
  return beans;
}

代码示例来源:origin: com.caucho/resin

boolean isEnabled(Bean<?> bean)
{
 if (! bean.isAlternative())
  return true;
 
 if (_deploymentMap.containsKey(bean.getBeanClass()))
  return true;
 
 for (Class<?> stereotype : bean.getStereotypes()) {
  if (_deploymentMap.containsKey(stereotype))
   return true;
 }
 
 return false;
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * @return <code>true</code> if the given bean is a configured alternative
 */
public boolean isAlternative(Bean<?> bean)
{
  return isAlternative(bean.getBeanClass(), bean.getStereotypes());
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
  @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "bca")
  public void configuratorInitializedWithOriginalBeanAttributes() {
    Bean<Mace> configuredBean = getUniqueBean(Mace.class);
    BeanAttributes<Mace> originalBA = getCurrentManager().getExtension(ProcessBeanAttributesObserver.class).getOriginalBA();
    assertEquals(configuredBean.getTypes(), originalBA.getTypes());
    assertEquals(configuredBean.getQualifiers(), originalBA.getQualifiers());
    assertEquals(configuredBean.getStereotypes(), originalBA.getStereotypes());
    assertEquals(configuredBean.getScope(), originalBA.getScope());
  }
}

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

@Override
public boolean test(Bean<?> bean) {
  return testBda(bda, bean) && testEquals(kind, BeanKind.from(bean)) && testContainsIgnoreCase(beanClass, bean.getBeanClass())
      && testContainsIgnoreCase(scope, bean.getScope()) && testAnyContains(beanType, bean.getTypes())
      && testAnyContains(qualifier, bean.getQualifiers()) && testEquals(isAlternative, bean.isAlternative())
      && testAnyContains(stereotypes, bean.getStereotypes()) && testUnused(bean);
}

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

@Override
public boolean test(Bean<?> bean) {
  return testBda(bda, bean) && testEquals(kind, BeanKind.from(bean)) && testContainsIgnoreCase(beanClass, bean.getBeanClass())
      && testContainsIgnoreCase(scope, bean.getScope()) && testAnyContains(beanType, bean.getTypes())
      && testAnyContains(qualifier, bean.getQualifiers()) && testEquals(isAlternative, bean.isAlternative())
      && testAnyContains(stereotypes, bean.getStereotypes()) && testUnused(bean);
}

代码示例来源:origin: weld/core

@Override
public boolean test(Bean<?> bean) {
  return testBda(bda, bean) && testEquals(kind, BeanKind.from(bean)) && testContainsIgnoreCase(beanClass, bean.getBeanClass())
      && testContainsIgnoreCase(scope, bean.getScope()) && testAnyContains(beanType, bean.getTypes())
      && testAnyContains(qualifier, bean.getQualifiers()) && testEquals(isAlternative, bean.isAlternative())
      && testAnyContains(stereotypes, bean.getStereotypes()) && testUnused(bean);
}

代码示例来源:origin: weld/core

@Override
public boolean test(Bean<?> bean) {
  return testBda(bda, bean) && testEquals(kind, BeanKind.from(bean)) && testContainsIgnoreCase(beanClass, bean.getBeanClass())
      && testContainsIgnoreCase(scope, bean.getScope()) && testAnyContains(beanType, bean.getTypes())
      && testAnyContains(qualifier, bean.getQualifiers()) && testEquals(isAlternative, bean.isAlternative())
      && testAnyContains(stereotypes, bean.getStereotypes()) && testUnused(bean);
}

代码示例来源:origin: weld/core

@Override
public boolean test(Bean<?> bean) {
  return testBda(bda, bean) && testEquals(kind, BeanKind.from(bean)) && testContainsIgnoreCase(beanClass, bean.getBeanClass())
      && testContainsIgnoreCase(scope, bean.getScope()) && testAnyContains(beanType, bean.getTypes())
      && testAnyContains(qualifier, bean.getQualifiers()) && testEquals(isAlternative, bean.isAlternative())
      && testAnyContains(stereotypes, bean.getStereotypes()) && testUnused(bean);
}

相关文章