Examples of Annotated


Examples of javax.enterprise.inject.spi.Annotated

        configKey = p.getMember().getName();
        configValue = globalProperties.getProperty(configKey);
        if (configValue != null) return configValue;

        // Return the default value if any.
        Annotated annotated = p.getAnnotated();
        Config config = annotated.getAnnotation(Config.class);
        if (config != null) return config.value();
        return null;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

   @Produces
   Configuration getUserConfiguration(InjectionPoint ip) throws ConfigurationException
   {
      Configuration config = getUserConfiguration();
      Annotated annotated = ip.getAnnotated();
      if (annotated.isAnnotationPresent(Subset.class))
      {
         config = config.subset(annotated.getAnnotation(Subset.class).value());
      }
      return config;
   }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

      }
   }

   public void processRemoteInjectionPointConsumer(@Observes ProcessInjectionPoint<?, ?> event, BeanManager manager)
   {
      Annotated annotated = event.getInjectionPoint().getAnnotated();

      Class<?> injectionPointDeclaringType = Types.toClass(event.getInjectionPoint().getMember().getDeclaringClass());
      Class<?> injectionBeanValueType = Types.toClass(annotated.getBaseType());

      Class<?> injectionPointConsumingType = null;
      if (event.getInjectionPoint().getBean() != null)
         injectionPointConsumingType = event.getInjectionPoint().getBean().getBeanClass();
      else
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

   {
      // needs to happen in the addon that is requesting the service
      for (final Entry<InjectionPoint, Class<?>> entry : requestedServices.entrySet())
      {
         final InjectionPoint injectionPoint = entry.getKey();
         final Annotated annotated = injectionPoint.getAnnotated();
         final Member member = injectionPoint.getMember();

         Class<?> beanClass = entry.getValue();
         Set<Type> typeClosure = annotated.getTypeClosure();
         Set<Type> beanTypeClosure = new LinkedHashSet<>();
         for (Type type : typeClosure)
         {
            beanTypeClosure.add(reifyWildcardsToObjects(type));
         }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

    @SuppressWarnings("rawtypes")
    @Test
    public void testInjectionPointGetAnnotated() {

        Annotated fooFieldAnnotated = bar.getFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooFieldAnnotated instanceof AnnotatedField);
        assertEquals(((AnnotatedField) fooFieldAnnotated).getJavaMember().getName(), "fooInstance");

        Annotated fooInitializerAnnnotated = bar.getInitializerFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooInitializerAnnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) fooInitializerAnnnotated).getPosition(), 0);

        Annotated fooConstructorAnnnotated = bar.getConstructorInjectionFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooConstructorAnnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) fooConstructorAnnnotated).getPosition(), 0);
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

        configKey = p.getMember().getName();
        configValue = globalProperties.getProperty(configKey);
        if (configValue != null) return configValue;

        // Return the default value if any.
        Annotated annotated = p.getAnnotated();
        Config config = annotated.getAnnotation(Config.class);
        if (config != null) return config.value();
        return null;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

   <T> void saveRemoteInjectionPoints(@Observes ProcessInjectionTarget<T> event, BeanManager beanManager) {
      final InjectionTarget<T> injectionTarget = event.getInjectionTarget();

      for (InjectionPoint injectionPoint : injectionTarget.getInjectionPoints()) {
         final Annotated annotated = injectionPoint.getAnnotated();
         final Type type = annotated.getBaseType();
         final Class<?> rawType = getRawType(annotated.getBaseType());
         final Set<Annotation> qualifiers = getQualifiers(beanManager, annotated.getAnnotations());

         if (rawType.equals(RemoteCache.class) && qualifiers.isEmpty()) {
            qualifiers.add(new AnnotationLiteral<Default>() {});
            addRemoteCacheInjectionPoint(type, qualifiers);

         } else if (!annotated.isAnnotationPresent(Remote.class)
               && getMetaAnnotation(annotated, Remote.class) != null
               && rawType.isAssignableFrom(RemoteCache.class)) {

            addRemoteCacheInjectionPoint(type, qualifiers);
         }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

        configKey = p.getMember().getName();
        configValue = globalProperties.getProperty(configKey);
        if (configValue != null) return configValue;

        // Return the default value if any.
        Annotated annotated = p.getAnnotated();
        Config config = annotated.getAnnotation(Config.class);
        if (config != null) return config.value();
        return null;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

  public void resolveSpecializes()
  {
    for (int i = _beanList.size() - 1; i >= 0; i--) {
      BeanEntry entry = _beanList.get(i);
     
      Annotated ann = entry.getAnnotated();
     
      if (ann == null || ! ann.isAnnotationPresent(Specializes.class))
        continue;
    }
  }
View Full Code Here

Examples of javax.enterprise.inject.spi.Annotated

    return baseType.getRawClass();
  }
 
  private void validateNormal(Bean<?> bean)
  {
    Annotated ann = null;
   
    if (bean instanceof AbstractBean) {
      AbstractBean absBean = (AbstractBean) bean;
     
      ann = absBean.getAnnotated();
    }
   
    if (ann == null)
      return;
   
    Type baseType = ann.getBaseType();
   
    Class<?> cl = createTargetBaseType(baseType).getRawClass();
   
    if (cl.isInterface())
      return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.