org.springframework.beans.factory.annotation.Value
を使うとよい。
ただし、まとまった単位で管理したいときは @ConfigurationProperties
を使うのがよさげ。
例
@Configuration public class AppConfig { @Value("${spring.datasource.schema}") private String schemaName; public String getSchemaName() { return schemaName; } }