I wish to create a map within my spring.xml. The closest I can get is a list of lists
<bean id="transformerHelper" class="com.common.TransformerHelper">
<property name="srcSystemIDList" value="{T(java.util.Arrays).asList({'11','50'},{'41','50'}) }" />
</bean>
However I really need these values in a map where I can return 50 when searching the key 11 or 41. I need this metadata defined in Spring as it will be stored away from the application.
There is a way, I recommend to add another property to your class, a String that will hold all the map values (keys and values), something like you already have:
Then, instead of injecting the map, inject the string and in it’s setter method (if you are using setter injection) call a small method (created by you) that will parse that string and populate the map, use
StringTokenizeror what ever you like.