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

x33g5p2x  于2022-01-18 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(103)

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

Decorator.getDecoratedTypes介绍

[英]All the interfaces and classes in the type hierarchy of the class annotated with @ javax.decorator.Decorator.
[中]用@javax注释的类的类型层次结构中的所有接口和类。室内装修设计师室内装修设计师

代码示例

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

@Override
public Set<Type> getDecoratedTypes() {
  return delegate().getDecoratedTypes();
}

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

protected void checkDecorator(Decorator<?> decorator, Class<?> beanClass, Set<Type> decoratedTypes, Type delegateType) {
  assertEquals(decorator.getBeanClass(), beanClass);
  assertEquals(decorator.getDecoratedTypes(), decoratedTypes);
  assertEquals(decorator.getDelegateType(), delegateType);
}

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

/**
 * @throws DefinitionException if {@link javax.enterprise.inject.spi.Decorator#getDecoratedTypes()} isEmpty
 */
private void validateDecoratorDecoratedTypes()
{
  for (Decorator decorator : decoratorsManager.getDecorators())
  {
    if (decorator.getDecoratedTypes().isEmpty())
    {
      throw new WebBeansConfigurationException("Decorator must implement at least one interface (java.io.Serializeable will be ignored)");
    }
  }
}

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

@Test
@SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "ack") })
public void testDecoratorIsResolved() {
  List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(
      Collections.<Type> singleton(ServletContext.class));
  assertEquals(2, decorators.size());
  for (Decorator<?> decorator : decorators) {
    assertEquals(decorator.getDecoratedTypes(), Collections.singleton(ServletContext.class));
    assertEquals(decorator.getDelegateType(), ServletContext.class);
  }
}

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

@SuppressWarnings("unchecked")
@Test
@SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "aci") })
public void testDecoratorIsResolved() {
  List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(
      Collections.<Type> singleton(HttpServletRequest.class));
  assertEquals(2, decorators.size());
  for (Decorator<?> decorator : decorators) {
    assertEquals(decorator.getDecoratedTypes(),
        new HashSet<Type>(Arrays.asList(HttpServletRequest.class, ServletRequest.class)));
    assertEquals(decorator.getDelegateType(), HttpServletRequest.class);
  }
}

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

@Test(groups = INTEGRATION)
@SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acj"), @SpecAssertion(section = DECORATOR_RESOLUTION, id = "aa") })
public void testDecoratorIsResolved() {
  List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Collections.<Type> singleton(HttpSession.class));
  assertEquals(2, decorators.size());
  for (Decorator<?> decorator : decorators) {
    assertEquals(decorator.getDecoratedTypes(), Collections.<Type> singleton(HttpSession.class));
    assertEquals(decorator.getDelegateType(), HttpSession.class);
  }
}

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

/**
 * Check whether the delegate type implements or extends all decorated types.
 *
 * @param decorator
 * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types
 */
public static void checkDelegateType(Decorator<?> decorator) {
  Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure();
  for (Type decoratedType : decorator.getDecoratedTypes()) {
    if(!types.contains(decoratedType)) {
      throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator);
    }
  }
}

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

/**
 * Check whether the delegate type implements or extends all decorated types.
 *
 * @param decorator
 * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types
 */
public static void checkDelegateType(Decorator<?> decorator) {
  Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure();
  for (Type decoratedType : decorator.getDecoratedTypes()) {
    if(!types.contains(decoratedType)) {
      throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator);
    }
  }
}

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

/**
 * Check whether the delegate type implements or extends all decorated types.
 *
 * @param decorator
 * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types
 */
public static void checkDelegateType(Decorator<?> decorator) {
  Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure();
  for (Type decoratedType : decorator.getDecoratedTypes()) {
    if(!types.contains(decoratedType)) {
      throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator);
    }
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

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

private void validateDecorator(Decorator<?> decorator) {
  Set<Annotation> qualifiers = decorator.getDelegateQualifiers();
  if (decorator.getDelegateType() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator);
  }
  Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers");
  if (decorator.getDecoratedTypes() == null) {
    throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator);
  }
}

相关文章