configurator.filterConstructors(constructor -> !Modifier.isPrivate(constructor.getJavaMember().getModifiers())) .forEach(constructor -> { METRIC_ANNOTATIONS.forEach(annotation -> {
void observesCountrysidePAT(@Observes ProcessAnnotatedType<Countryside> event) { AnnotatedConstructorConfigurator<Countryside> annotatedConstructorConfigurator = event.configureAnnotatedType() .filterConstructors(constructor -> constructor.isAnnotationPresent(Inject.class)).findFirst().get(); //add qualifier to each constructor param annotatedConstructorConfigurator.params().forEach(annotatedParam -> annotatedParam.add(Wild.WildLiteral.INSTANCE)); }
.filterConstructors(ac -> ac.isAnnotationPresent(Inject.class)) .findFirst().get();
void observesCatPAT(@Observes ProcessAnnotatedType<Cat> event) { AnnotatedTypeConfigurator<Cat> annotatedTypeConfigurator = event.configureAnnotatedType(); originalCatAT = annotatedTypeConfigurator.getAnnotated(); // remove @RequestScoped from Cat annotatedTypeConfigurator.remove(a -> a.annotationType().equals(RequestScoped.class)); // remove @Produces and @Cats Cat.produceCatName() getAMConfiguratorByName(annotatedTypeConfigurator, "produceCatFeed").remove(a -> a.equals(ProducesLiteral.INSTANCE)) .remove(a -> a.equals(Cats.CatsLiteral.INSTANCE)); // remove @Inject from Cat.feed annotatedTypeConfigurator.filterFields(af -> af.getJavaMember().getName().equals("feed")).findFirst().get() .remove(a -> a.equals(InjectLiteral.INSTANCE)); // remove @Inject and @Cats from constructor with parameter annotatedTypeConfigurator.filterConstructors(ac -> ac.getParameters().size() == 1 && ac.getParameters().get(0).getBaseType().equals(Feed.class)) .findFirst().get().remove(a -> a.equals(InjectLiteral.INSTANCE)).params().get(0).remove(a -> a.equals(Cats.CatsLiteral.INSTANCE)); // remove @Observes from Cat.observesCatsFeed method parameter getAMConfiguratorByName(annotatedTypeConfigurator, "observesCatsFeed") .filterParams(ap -> ap.getPosition() == 0).findFirst().get().remove(a -> a.annotationType().equals(Observes.class)); }
configurator.filterConstructors(constructor -> !Modifier.isPrivate(constructor.getJavaMember().getModifiers())) .forEach(constructor -> { METRIC_ANNOTATIONS.forEach(annotation -> {