使用@Value的属性文件中的条目填充HashMap

时间:2015-08-06 12:20:24

标签: java spring spring-annotations

我的属性文件有一个像这样的键company.id

company.id=key1=value1,key2=value2,key3=value4

现在,我想使用@Value of spring

直接在地图中存储键值对
//For example,
//for key in properties file
//company.list=comp1,comp2
@Value("#{'${proposal.provience}'.split(',')}")
List<String> companyList;
the above will directly converts to List.

请告诉我在这里写什么而不使用像Guava这样的其他库

@value(some logic here)
HashMap<String,String> map;

0 个答案:

没有答案
相关问题