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

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

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

Decorator.getInjectionPoints介绍

暂无

代码示例

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

  1. private static InjectionPoint getDelegate(Decorator<?> bean)
  2. {
  3. if (bean instanceof DecoratorBean)
  4. return ((DecoratorBean) bean).getDelegateInjectionPoint();
  5. for (InjectionPoint ip : bean.getInjectionPoints()) {
  6. if (ip.isDelegate())
  7. return ip;
  8. }
  9. throw new IllegalStateException(String.valueOf(bean));
  10. }

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

  1. @Test
  2. @SpecAssertions({ @SpecAssertion(section = INJECTION_POINT_CONFIGURATOR, id = "bc"),
  3. @SpecAssertion(section = INJECTION_POINT_CONFIGURATOR, id = "be")
  4. })
  5. public void replaceQualifiersAndDelegate() {
  6. List<Decorator<?>> vehicleDecorators = getCurrentManager().resolveDecorators(Collections.<Type>singleton(Car.class), Driving.DrivingLiteral.INSTANCE);
  7. assertEquals(vehicleDecorators.size(), 1);
  8. Decorator<Car> vehicleDecorator = (Decorator<Car>) vehicleDecorators.get(0);
  9. assertEquals(vehicleDecorator.getInjectionPoints().size(), 1);
  10. InjectionPoint vehicleIp = vehicleDecorator.getInjectionPoints().iterator().next();
  11. assertEquals(vehicleIp.isDelegate(), true);
  12. assertEquals(vehicleIp.getQualifiers(), Collections.singleton(Driving.DrivingLiteral.INSTANCE));
  13. }

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

  1. @SuppressWarnings("unchecked")
  2. @Test
  3. @SpecAssertions({ @SpecAssertion(section = DELEGATE_ATTRIBUTE, id = "a"), @SpecAssertion(section = DECORATOR, id = "c") })
  4. public void testDelegateInjectionPoint() {
  5. List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Logger.TYPES);
  6. assertEquals(decorators.size(), 1);
  7. Decorator<?> decorator = decorators.get(0);
  8. assertEquals(decorator.getInjectionPoints().size(), 1);
  9. assertEquals(decorator.getInjectionPoints().iterator().next().getType(),Logger.class);
  10. assertTrue(decorator.getInjectionPoints().iterator().next().getAnnotated().isAnnotationPresent(Delegate.class));
  11. assertEquals(decorator.getDelegateType(), Logger.class);
  12. assertEquals(decorator.getDelegateQualifiers().size(), 1);
  13. assertAnnotationSetMatches(decorator.getDelegateQualifiers(), Default.class);
  14. }

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

  1. @Test
  2. @SpecAssertions({
  3. @SpecAssertion(section="8.1.2", id="a"),
  4. @SpecAssertion(section="11.1.1", id="c")
  5. })
  6. public void testDelegateInjectionPoint()
  7. {
  8. List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Logger.TYPES);
  9. assert decorators.size() == 1;
  10. Decorator<?> decorator = decorators.get(0);
  11. assert decorator.getInjectionPoints().size() == 1;
  12. assert decorator.getInjectionPoints().iterator().next().getType().equals(Logger.class);
  13. assert decorator.getInjectionPoints().iterator().next().getAnnotated().isAnnotationPresent(Delegate.class);
  14. assert decorator.getDelegateType().equals(Logger.class);
  15. assert decorator.getDelegateQualifiers().size() == 1;
  16. assert annotationSetMatches(decorator.getDelegateQualifiers(), Default.class);
  17. }

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. for (Decorator<?> animalDecorator : animalDecorators) {
  2. assert animalDecorator.getInjectionPoints().size() == 2;
  3. for (InjectionPoint injectionPoint : animalDecorator.getInjectionPoints()) {
  4. if (injectionPoint.getType().equals(InjectionPoint.class)) {
  5. assertFalse(injectionPoint.isDelegate());

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. Decorators.findDelegateInjectionPoint(annotated, decorator.getInjectionPoints());

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

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

  1. private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) {
  2. if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) {
  3. return;
  4. }
  5. List<Decorator<?>> decorators = bean.getDecorators();
  6. if (decorators.isEmpty()) {
  7. return;
  8. }
  9. for (Decorator<?> decorator : decorators) {
  10. if (!Decorators.isPassivationCapable(decorator)) {
  11. if (bean instanceof AbstractDecorableBuiltInBean<?>) {
  12. throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean);
  13. } else {
  14. throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator);
  15. }
  16. }
  17. if (decorator instanceof DecoratorImpl) {
  18. beanManager = ((DecoratorImpl<?>) decorator).getBeanManager();
  19. }
  20. for (InjectionPoint ij : decorator.getInjectionPoints()) {
  21. if (!ij.isDelegate()) {
  22. Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij));
  23. validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean);
  24. }
  25. }
  26. }
  27. }

相关文章