Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Annotated


            if (anno.annotationType().equals(Default.class)) continue;
           
            if (anno.annotationType().equals(Named.class)) {
                Named named = (Named) anno;
                if ("".equals(named.value())) {
                    Annotated annotated = injectionPoint.getAnnotated();
                    if (annotated instanceof AnnotatedField) {
                        AnnotatedField<?> annotatedField = (AnnotatedField<?>) annotated;
                       
                        Field field = annotatedField.getJavaMember();
                        anno = new NamedImpl(field.getName());
View Full Code Here


        InjecteeImpl retVal = new InjecteeImpl(injectionPoint.getType());
       
        retVal.setRequiredQualifiers(getHK2Qualifiers(injectionPoint));
        retVal.setParent((AnnotatedElement) injectionPoint.getMember())// Also sets InjecteeClass
       
        Annotated annotated = injectionPoint.getAnnotated();
        if (annotated instanceof AnnotatedField) {
            retVal.setPosition(-1);
        }
        else {
            AnnotatedParameter<?> annotatedParameter = (AnnotatedParameter<?>) annotated;
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.5.10", id = "baa") })
    public void testManagedBeanAnnotated() {
        Annotated alphaAnnotated = extension.getAnnotatedMap().get(Alpha.class);
        assertNotNull(alphaAnnotated);
        assertTrue(alphaAnnotated instanceof AnnotatedType);
        @SuppressWarnings("unchecked")
        AnnotatedType<Alpha> alphaAnnotatedType = (AnnotatedType<Alpha>) alphaAnnotated;
        assertEquals(alphaAnnotatedType.getJavaClass(), Alpha.class);
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.5.10", id = "bab") })
    public void testSessionBeanAnnotated() {
        Annotated deltaAnnotated = extension.getAnnotatedMap().get(Delta.class);
        assertNotNull(deltaAnnotated);
        assertTrue(deltaAnnotated instanceof AnnotatedType);
        @SuppressWarnings("unchecked")
        AnnotatedType<Delta> deltaAnnotatedType = (AnnotatedType<Delta>) deltaAnnotated;
        assertEquals(deltaAnnotatedType.getJavaClass(), Delta.class);
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.5.10", id = "bac") })
    public void testProducerMethodAnnotated() {
        Annotated bravoAnnotated = extension.getAnnotatedMap().get(Bravo.class);
        assertNotNull(bravoAnnotated);
        assertTrue(bravoAnnotated instanceof AnnotatedMethod);
        @SuppressWarnings("unchecked")
        AnnotatedMethod<Bravo> bravoAnnotatedMethod = (AnnotatedMethod<Bravo>) bravoAnnotated;
        assertEquals(bravoAnnotatedMethod.getJavaMember().getName(), "createBravo");
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.5.10", id = "bad") })
    public void testProducerFieldAnnotated() {
        Annotated charlieAnnotated = extension.getAnnotatedMap().get(Charlie.class);
        assertNotNull(charlieAnnotated);
        assertTrue(charlieAnnotated instanceof AnnotatedField);
        @SuppressWarnings("unchecked")
        AnnotatedField<Charlie> charlieAnnotatedField = (AnnotatedField<Charlie>) charlieAnnotated;
        assertEquals(charlieAnnotatedField.getJavaMember().getName(), "charlie");
View Full Code Here

    @Produces
    @FXMLLoaderParams
    FXMLLoader createCdiFXMLLoader(final InjectionPoint injectionPoint) {

        final Annotated annotated = injectionPoint.getAnnotated();
        final Class<?> declaringClass = injectionPoint.getMember().getDeclaringClass();

        final FXMLLoader loader = new FXMLLoader() {
        };

        // Uses the currently loaded CDI implementation to look up controller classes
        // that have been specified via "fx:controller='...'" in our FXML files.
        loader.setControllerFactory((aClass) -> CDI.current().select(aClass));

        // If an annotation of type @FXMLLoaderParams can be found, use it's parameters
        // to configure the FXMLLoader instance that shall be used to perform the loading
        // of the FXML file.
        final FXMLLoaderParams fxmlLoaderParams = annotated.getAnnotation(FXMLLoaderParams.class);
        if (fxmlLoaderParams != null) {

            // Checks the location that has been specified (if any) and uses the default
            // class loader to create an URL that points to a FXML file on the classpath.
            final String location = fxmlLoaderParams.location();
View Full Code Here

      }
   }

   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());

      if (Instance.class.isAssignableFrom(injectionBeanValueType))
      {
         Type type = event.getInjectionPoint().getType();
         if (type instanceof ParameterizedType)
View Full Code Here

   {
      // 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();

         Set<Type> typeClosure = annotated.getTypeClosure();
         Class<?> beanClass = entry.getValue();

         Bean<?> serviceBean = new BeanBuilder<Object>(manager)
                  .beanClass(beanClass)
                  .types(typeClosure)
View Full Code Here

      }
   }

   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());

      if (Instance.class.isAssignableFrom(injectionBeanValueType))
      {
         Type type = event.getInjectionPoint().getType();
         if (type instanceof ParameterizedType)
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.