Package io.micronaut.context.annotation
Annotation Type EachBean
-
@Documented @Retention(RUNTIME) @Target({METHOD,TYPE}) @Singleton public @interface EachBeanThis annotation allows driving the production of
Beandefinitions from presence of other bean definitions. Typically used in conjunction withEachPropertyFor example:
@EachProperty("foo.bar") public class ExampleConfiguration { }In the above example a new
ExampleConfigurationbean will be created for each item under thefoo.barkey in application configurationOne can then drive the configuration of other beans with the same annotation:
@EachBean(ExampleConfiguration) @Singleton public class ExampleBean { ExampleBean(ExampleConfiguration config) { ... } }- Since:
- 1.0
- See Also:
EachProperty,ConfigurationProperties
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Classvalue
-