Search in sources :

Example 11 with AnnotatedType

use of jakarta.enterprise.inject.spi.AnnotatedType in project myfaces by apache.

the class FacesConfigExtension method beforeBeanDiscovery.

void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) {
    AnnotatedType beanHolder = beanManager.createAnnotatedType(FacesConfigBeanHolder.class);
    event.addAnnotatedType(beanHolder, beanHolder.getJavaClass().getName());
}
Also used : AnnotatedType(jakarta.enterprise.inject.spi.AnnotatedType)

Example 12 with AnnotatedType

use of jakarta.enterprise.inject.spi.AnnotatedType in project myfaces by apache.

the class FacesDataModelExtension method beforeBeanDiscovery.

void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event, BeanManager beanManager) {
    AnnotatedType beanHolder = beanManager.createAnnotatedType(FacesDataModelManager.class);
    event.addAnnotatedType(beanHolder, beanHolder.getJavaClass().getName());
}
Also used : AnnotatedType(jakarta.enterprise.inject.spi.AnnotatedType)

Example 13 with AnnotatedType

use of jakarta.enterprise.inject.spi.AnnotatedType in project myfaces by apache.

the class ViewScopeExtension method beforeBeanDiscovery.

void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) {
    event.addScope(ViewScoped.class, true, true);
    // Register ViewScopeBeanHolder as a bean with CDI annotations, so the system
    // can take it into account, and use it later when necessary.
    AnnotatedType bean = beanManager.createAnnotatedType(ViewScopeContextualStorageHolder.class);
    event.addAnnotatedType(bean, bean.getJavaClass().getName());
}
Also used : AnnotatedType(jakarta.enterprise.inject.spi.AnnotatedType)

Example 14 with AnnotatedType

use of jakarta.enterprise.inject.spi.AnnotatedType in project cdi-tck by jakartaee.

the class VerifyValuesTest method testSessionBeanAnnotated.

@Test
@SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES_EE, 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);
    assertEquals(deltaAnnotatedType.getMethods().size(), 1);
    assertEquals(deltaAnnotatedType.getMethods().iterator().next().getJavaMember().getName(), "foo");
}
Also used : Annotated(jakarta.enterprise.inject.spi.Annotated) AnnotatedType(jakarta.enterprise.inject.spi.AnnotatedType) SpecAssertions(org.jboss.test.audit.annotations.SpecAssertions) Test(org.testng.annotations.Test) AbstractTest(org.jboss.cdi.tck.AbstractTest)

Example 15 with AnnotatedType

use of jakarta.enterprise.inject.spi.AnnotatedType in project cdi-tck by jakartaee.

the class VerifyValuesTest method testManagedBeanAnnotated.

@Test
@SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, 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);
    assertEquals(alphaAnnotatedType.getMethods().size(), 0);
}
Also used : Annotated(jakarta.enterprise.inject.spi.Annotated) AnnotatedType(jakarta.enterprise.inject.spi.AnnotatedType) SpecAssertions(org.jboss.test.audit.annotations.SpecAssertions) Test(org.testng.annotations.Test) AbstractTest(org.jboss.cdi.tck.AbstractTest)

Aggregations

AnnotatedType (jakarta.enterprise.inject.spi.AnnotatedType)28 AnnotatedMethod (jakarta.enterprise.inject.spi.AnnotatedMethod)8 CreationalContext (jakarta.enterprise.context.spi.CreationalContext)5 Annotated (jakarta.enterprise.inject.spi.Annotated)5 Annotation (java.lang.annotation.Annotation)5 Type (java.lang.reflect.Type)5 InjectionTarget (jakarta.enterprise.inject.spi.InjectionTarget)4 Method (java.lang.reflect.Method)4 AbstractTest (org.jboss.cdi.tck.AbstractTest)4 SpecAssertions (org.jboss.test.audit.annotations.SpecAssertions)4 Test (org.junit.Test)4 Test (org.testng.annotations.Test)4 InjectionPoint (jakarta.enterprise.inject.spi.InjectionPoint)3 HashSet (java.util.HashSet)3 Set (java.util.Set)3 EnhancedAnnotatedType (org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType)3 ForwardingAnnotatedType (org.jboss.weld.util.annotated.ForwardingAnnotatedType)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ForwardingInjectionPoint (org.jboss.cdi.tck.util.ForwardingInjectionPoint)2 InProcessGrpcChannel (io.helidon.microprofile.grpc.core.InProcessGrpcChannel)1