0

In my micronaut application I have various Enum fields that contain an annotation (AnnotationA). When this annotation is placed on a Bean class (not an enum), I can use the following statement to retrieve all of the Bean definitions containing this annotation.

applicationContext.getBeanDefinitions(Qualifiers.byStereotype(AnnotationA.class))

But when the same annotation is placed on an enum value I cannot use this same call to retrieve all of the enums that have this annotation. Would anyone happen to know of a way that I can retrieve the enum values containing this annotation?

Ronnie Phelps
  • 83
  • 1
  • 11
  • afaik enum cannot be Micronaut beans. but can you explain our use case and what are you trying to solve? – saw303 Mar 19 '20 at 06:16
  • That is correct. There would be no reason to have an enum value as a bean in the application context. Beans could have enum value properties in them, but the enum values would not be beans as there is no reason to do that. – Jeff Scott Brown Mar 19 '20 at 15:10
  • So my use case is that I have enums that have annotations on the elements and i would like to load all enums containing those annotations without using java reflections. – Ronnie Phelps Mar 22 '20 at 22:39

0 Answers0