Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Annotated


      return;
   
    for (int i = beans.size() - 1; i >= 0; i--) {
      TypedBean bean = beans.get(i);
     
      Annotated ann = bean.getAnnotated();
     
      if (ann == null || ! ann.isAnnotationPresent(Specializes.class))
        continue;

      for (int j = beans.size() - 1; j >= 0; j--) {
        if (i == j)
          continue;
       
        TypedBean bean2 = beans.get(j);
       
        // XXX:
       
        Annotated ann2 = bean.getAnnotated();
       
        if (ann2 == null)
          continue;
       
        if (isSpecializes(ann, ann2) && isMatchInject(bean, bean2)) {
View Full Code Here


    boolean isModulePrivate(Bean<?> bean)
    {
      if (! (bean instanceof AnnotatedBean))
        return false;

      Annotated annotated = ((AnnotatedBean) bean).getAnnotated();

      if (annotated == null)
        return false;

      for (Annotation ann : annotated.getAnnotations()) {
        Class<?> annType = ann.annotationType();

        if (annType.equals(ModulePrivate.class)
            || annType.isAnnotationPresent(ModulePrivate.class)
            || annType.equals(Module.class)
View Full Code Here

      _loader = Thread.currentThread().getContextClassLoader();

      if (bean instanceof AbstractBean) {
        AbstractBean<X> absBean = (AbstractBean<X>) bean;
        Annotated annotated = absBean.getAnnotated();

        if (annotated != null
            && annotated.isAnnotationPresent(ContextDependent.class)) {
          // ioc/0e17
          _loader = null;
        }
      }
    }
View Full Code Here

{
   @Produces
   @TypedMessageLogger
   Object produceTypedLogger(InjectionPoint injectionPoint)
   {
      Annotated annotated = injectionPoint.getAnnotated();
      if (annotated.isAnnotationPresent(Category.class))
      {
         if (annotated.isAnnotationPresent(Locale.class))
         {        
            return getMessageLogger(getInjectionPointRawType(injectionPoint), annotated.getAnnotation(Category.class).value(), toLocale(annotated.getAnnotation(Locale.class).value()));
         }
         else
         {
            return getMessageLogger(getInjectionPointRawType(injectionPoint), annotated.getAnnotation(Category.class).value());
         }  
      }
      else if (annotated.isAnnotationPresent(TypedCategory.class))
      {
         if (annotated.isAnnotationPresent(Locale.class))
         {        
            return getMessageLogger(getInjectionPointRawType(injectionPoint), annotated.getAnnotation(TypedCategory.class).value().getName(), toLocale(annotated.getAnnotation(Locale.class).value()));
         }
         else
         {
            return getMessageLogger(getInjectionPointRawType(injectionPoint), annotated.getAnnotation(TypedCategory.class).value().getName());
         }
      }
      else
      {
         if (annotated.isAnnotationPresent(Locale.class))
         {        
            return getMessageLogger(getInjectionPointRawType(injectionPoint), getDeclaringRawType(injectionPoint).getName(), toLocale(annotated.getAnnotation(Locale.class).value()));
         }
         else
         {
            return getMessageLogger(getInjectionPointRawType(injectionPoint), getDeclaringRawType(injectionPoint).getName());
         }
View Full Code Here

      }
   }

   private static InjectionPoint wrapInjectionPoint(InjectionPoint injectionPoint, Set<Annotation> quals)
   {
      Annotated anotated = injectionPoint.getAnnotated();
      boolean genericInjectionPoint = false;
      if (injectionPoint.getType() instanceof Class<?>)
      {
         Class<?> c = (Class<?>) injectionPoint.getType();
         genericInjectionPoint = c.isAnnotationPresent(GenericConfiguration.class);
      }
      if (anotated.isAnnotationPresent(Disposes.class) || anotated.isAnnotationPresent(InjectGeneric.class) || genericInjectionPoint)
      {
         Set<Annotation> newQualifiers = new HashSet<Annotation>();
         newQualifiers.addAll(quals);
         newQualifiers.addAll(injectionPoint.getQualifiers());
         Iterator<Annotation> it = newQualifiers.iterator();
View Full Code Here

         }
         if(unwrapsMethods.containsKey(genericConfigurationType))
         {
            for(AnnotatedMethod<?> i : unwrapsMethods.get(genericConfigurationType))
            {
               Annotated annotated = genericConfigurationHolder.getAnnotated();
               Set<Annotation> unwrapsQualifiers = Beans.getQualifiers(beanManager, i.getAnnotations(), annotated.getAnnotations());
               if (unwrapsQualifiers.isEmpty())
               {
                  unwrapsQualifiers.add(DefaultLiteral.INSTANCE);
               }
               Set<Annotation> beanQualifiers = Beans.getQualifiers(beanManager, i.getDeclaringType().getAnnotations(), annotated.getAnnotations());
               beanQualifiers.remove(AnyLiteral.INSTANCE);
               if (beanQualifiers.isEmpty())
               {
                  beanQualifiers.add(DefaultLiteral.INSTANCE);
               }
View Full Code Here

{
   @Produces
   @TypedMessageBundle
   Object produceTypedMessageBundle(InjectionPoint injectionPoint)
   {
      Annotated annotated = injectionPoint.getAnnotated();
      if (annotated.isAnnotationPresent(Locale.class))
      {        
         return getBundle(getRawType(injectionPoint.getType()), toLocale(annotated.getAnnotation(Locale.class).value()));
      }
      else
      {
         return getBundle(getRawType(injectionPoint.getType()));
      }
View Full Code Here

        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

      return false;
    }

    @Override
    public Annotated getAnnotated() {
      return new Annotated() {

        @Override
        public Type getBaseType() {
          // TODO Auto-generated method stub
          return null;
View Full Code Here

     */
    @Produces
    @FXMLLoaderParams
    FXMLLoader createCdiFXMLLoader(final InjectionPoint injectionPoint) {
        final CdiFXMLLoader fxmlLoader = new CdiFXMLLoader();
        final Annotated annotated = injectionPoint.getAnnotated();
        final Class<?> declaringClass = injectionPoint.getMember().getDeclaringClass();
        if (annotated.isAnnotationPresent(FXMLLoaderParams.class)) {
            final FXMLLoaderParams annotation = annotated.getAnnotation(FXMLLoaderParams.class);
            initializeFXMLLoader(fxmlLoader, declaringClass, annotation.location(), annotation.resources(), annotation.charset());
        }
        return fxmlLoader;
    }
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.Annotated

Copyright © 2018 www.massapicom. 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.