title: Inject map of beans using Spring from properties file
body: <p>I am trying to control which beans populate a map from a properties file using Spring 3.  I believe this question is similar to <a href="https://stackoverflow.com/q/15416156/2083907">How to fill map, configured with spring, from properties file</a>, except in my case, my properties file has names of beans:</p>
  
  <pre><code>key1=bean1
  key2=bean2
  </code></pre>
  
  <p>I tried an xml like:</p>
  
  <pre><code>&lt;bean id="bean1" class="java.lang.String"&gt;
      &lt;constructor-arg value="habeas corpus"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="bean2" class="java.lang.String"&gt;
      &lt;constructor-arg value="platanos verdes"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="map" class="java.util.HashMap"&gt;
      &lt;constructor-arg ref="props"/&gt;
  &lt;/bean&gt;
  
  &lt;util:properties id="props" location="classpath:test.properties" /&gt;
  </code></pre>
  
  <p>But then <code>map</code> is <code>{key1: "bean1", key2: "bean2"}</code>, whereas I want <code>{key1: "habeas corpus", key2: "platanos verdes"}</code>.</p>
  
  <p>I am not wed to this approach, so any other ideas how I can control which beans populate the map would be great.</p>