Annotation Interface ConstructorBinding
@Target({CONSTRUCTOR,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Documented
@Deprecated(since="3.0.0",
forRemoval=true)
@ConstructorBinding
public @interface ConstructorBinding
Deprecated, for removal: This API element is subject to removal in a future version.
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:
ConstructorBinding