Annotation Interface ConstructorBinding


@Target(CONSTRUCTOR) @Retention(RUNTIME) @Documented 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 Spring mechanisms (e.g. @Component beans, beans created via @Bean methods or beans loaded using @Import).

Since:
2.2.0
Author:
Phillip Webb
See Also: