I need to load a java.util.List<Integer>
from a properties file that provides the comma separated integers.
ids = 1230, 34, 2587, 31
So far I've tried a identifiers.properties
file with the above contents and loading it in a bean with a spring xml file:
<bean id="identifiersList" class="MyIdHolderClass">
<property name="idsList" value="${ids}"/>
</bean>
But I get an error because the java.util.List<Integer> ids
cannot store a String, which is what Spring is trying to put in it.
Is there a way to spring-inject a list of numbers from a properties file?
Just for context: what I am trying to achieve is to load a Map<Integer, Float>
from a properties file. But failing to load it, I decided to split it in loading the keys and loading the values. (It will end up as a map that tells the price tag for each product identifier).