Slide 9
Slide 9 text
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@ConfigurationProperties
! Complete infrastructure to customize your auto-configuration
! Just add @EnableConfigurationProperties(MyProperties.class)
• Add that class as a bean in the context (i.e. you can inject it)
• Inject any key in the Environment that match the prefix + property name
• Works with system property, command-line switch, key in configuration file, etc.
! Add the annotation processor to your build
• Generate the relevant meta-data so that the IDE can pick that up
• Description (field javadoc), default value, type
! Make that an isolated (configuration-only) thing
9 @snicoll