Skip to main content

Lincoln Baxter III: How to @Inject Enum values into CDI beans

Lincoln Baxter III solves How to @Inject Enum values into CDI beans:

I was recently asked how to Inject a Java Enum into a bean constructor using CDI. This turns out to be a fairly interesting situation, because enums are not usually available for Injection. The first attempt: As much as we would hope for this to work, it does not. Enums are not beans because...

Community: Java Enterprise