@ConfigurationProperties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=External=
* https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/ConfigurationProperties.html
=Internal=
=Internal=



Revision as of 19:44, 22 November 2018

External

Internal

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 environment.

@Component
@ConfigurationProperties(prefix = "playground.spring.pi")
public class ... {
}

The 'prefix' attribute defines the namespace for the configuration properties exposed by the component.