@ConfigurationProperties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
=Overview=
=Overview=


@ConfigurationProperties is an 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]].
@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'>
<syntaxhighlight lang='java'>

Revision as of 04:41, 6 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.