Annotation Interface ConstructorBinding


@Documented @Target(CONSTRUCTOR) @Retention(RUNTIME) public @interface ConstructorBinding
Annotation that can be used to indicate which constructor to use when binding configuration properties using constructor arguments rather than by calling setters. A single parameterized constructor implicitly indicates that constructor binding should be used unless the constructor is annotated with `@Autowired`.

Note: To use constructor binding the class must be enabled using @EnableConfigurationProperties or configuration property scanning. Constructor binding cannot be used with beans that are created by the regular Framework mechanisms (e.g. @Component beans, beans created via @Bean methods or beans loaded using @Import).

从以下版本开始:
4.0
作者:
Phillip Webb, Harry Yang
另请参阅: