title: setting a Map type field in a bean (which will contain other beans), using XML
body: <p>so here's my question - </p>
  
  <p>lets say i have couple of services, Service_A, Service_B, etc..(all extends Service class)</p>
  
  <p>every service is a bean, and has a function getKey() that returns the key of the service - of type ServiceKey.</p>
  
  <p>now, i want to define a new bean - ServiceManager. which will have a memeber:</p>
  
  <pre><code>HashMap&lt;ServiceKey,Service&gt; serviceMap.
  </code></pre>
  
  <p>i wanted to ask, if there a way to inject all the existing Service types bean to this Map memeber using a bean definition in XML?</p>
  
  <p>something like this doesnt help me:</p>
  
  <pre><code>&lt;bean id="serviceManager" class="ServiceManager"&gt;
      &lt;property name="serviceMap"&gt;
          &lt;map&gt;
              &lt;entry key="A" value="service_a"/&gt;
              &lt;entry key="B" value="service_a"/&gt;
              &lt;entry key="C" value="service_c"/&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>i dont want it hard coded, i wonder if there's a way to take each existing Service class, and define it like this that the map will be field using the getKey() function from each service</p>
  
  <p>getKey(),Service</p>
  
  <p>thanks in advance!</p>