@ConfigurationProperties: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Spring Property Injection Concepts =Overview= @ConfigurationProperties is an annotation...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | |||
* https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/ConfigurationProperties.html | |||
=Internal= | =Internal= | ||
* [[ | * [[Spring_Boot_Property_Injection#.40ConfigurationProperties|Spring Boot Property Injection]] | ||
* [[@NestedConfigurationProperty]] | |||
=Overview= | =Overview= | ||
@ConfigurationProperties is | @ConfigurationProperties is a [[Spring Boot]] annotation that, once placed on a bean, specifies that the properties of that bean ban be injected from properties present in the [[Spring_Property_Injection_Concepts#The_Environment_Abstraction|Spring environment]]. | ||
<syntaxhighlight lang='java'> | |||
@Component | |||
@ConfigurationProperties(prefix = "playground.spring.pi") | |||
public class ... { | |||
} | |||
</syntaxhighlight> | |||
The 'prefix' attribute defines the namespace for the configuration properties exposed by the component. |
Latest revision as of 18:02, 13 December 2018
External
Internal
Overview
@ConfigurationProperties is a Spring Boot annotation that, once placed on a bean, specifies that the properties of that bean ban be injected from properties present in the Spring environment.
@Component
@ConfigurationProperties(prefix = "playground.spring.pi")
public class ... {
}
The 'prefix' attribute defines the namespace for the configuration properties exposed by the component.