@EnableConfigurationProperties

From NovaOrdis Knowledge Base
Revision as of 22:01, 21 January 2019 by Ovidiu (talk | contribs) (→‎Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

Can be used to register classes that are not components, yet still want to take advantage of @ConfigurationProperties mechanism. If a regular component is annotated with @ConfigurationProperties, it does not need help from @EnableConfigurationProperties.

Example

@EnableConfigurationProperties(MyConfig.class)
@ConfigurationProperties(prefix = "com.example.my.config")
public class MyConfig {

   ...
}