随笔 - 265  文章 - 10  评论 - 18  阅读 - 50万 

public class ConfigPropertySource extends PropertySource<Properties> implements PriorityOrdered, BeanFactoryPostProcessor, EnvironmentAware{

public void init() {
this.loadConfig();
this.env.getPropertySources().addFirst(this);
}

private Properties parseConfig(String config) {
Properties properties = new Properties();
if(StringUtils.isNotEmpty(config)) {
try {
properties.load(new StringReader(config));
} catch (Exception var4) {
throw new IllegalArgumentException("detail center parse config error, config:" + config, var4);
}
}

return properties;
}

public Object getProperty(String name) {
return this.source.get(name);
}

}

posted on   sidesky  阅读(2009)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示