0

I have properties file which has a key company.id like this

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

Now, I want to store key-value pair directly in map using @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.

Please tell me what to write here without using other libraries like Guava

@value(some logic here)
HashMap<String,String> map;
Bunty
  • 91
  • 1
  • 2
  • 11
  • 1
    possible duplicate of [How to fill HashMap from java property file with Spring @Value](http://stackoverflow.com/questions/28369458/how-to-fill-hashmap-from-java-property-file-with-spring-value) – Naman Gala Aug 06 '15 at 12:25
  • @NamanGala But i need to add another library as they are using PropertyMapper in @ Value – Bunty Aug 06 '15 at 13:18
  • You could use a @Value annotated setter and process the value in there? – PeterK Aug 06 '15 at 14:44
  • @PeterK thnaks for the answer.Thats what i'm doing now. – Bunty Aug 07 '15 at 12:38

0 Answers0