I'm working on a spring application where I need to get a Map from the property file. The sample Java code is
public static final Map<String, List<String>> txn = Collections.unmodifiableMap(new HashMap<String, List<String>>(){{
put("DIV",Arrays.asList("AA","CD","DD","EF"));
put("TFER", Arrays.asList("J","TE","EF","RE"));
put("PPO", Arrays.asList("PPIN","PPOUT"));
}});
Instead, the map txn needs to be mapped with values from the properties file. The property file looks like this
txn.type=DIV,TFER,PPO
DIV.values=AA,CD,DD,EF
TFER.values=J,TE,EF,RE
PPO.values=PPIN,PPOUT
I need the java program to get the values into the Map declaration from the properties file.