Generic Producer for CDI
Goal
Be able to return Object in a producer
Usage
@ApplicationScoped
public class MyProducer1 {
@Produces
@MyProducerQualifier1
public Object create(final InjectionPoint ip) {
// your logic like myFactory.find(ip.getAnnotated().getAnnotation(MyFactory.class).value());
}
}
@GenericQualifier
@Qualifier
@Target({ METHOD, FIELD })
@Retention(RUNTIME)
public @interface MyProducerQualifier1 {}