码迷,mamicode.com
首页 > 其他好文 > 详细

Autowired properities class

时间:2015-04-24 18:32:28      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

1. Properties类

@ConfigurationProperties(locations = "classpath:build.properties")

@JsonInclude(value = JsonInclude.Include.NON_EMPTY)

@JsonPropertyOrder(alphabetic = true)

public class BuildProperties {

    

    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)

    @JsonPropertyOrder(alphabetic = true)

    public static class Versions {

 

private String app;

private String spring;

private String springBoot;

private String hibernate;

private String angularjs;

private String bootstrap;

private String highcharts;

...

}

2. 配置类

@Configuration

@EnableConfigurationProperties(BuildProperties.class)

public class PropertiesConfig {

}

 

Autowired properities class

标签:

原文地址:http://www.cnblogs.com/feika/p/4454122.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!