title: Defining a hashmap as a bean
body: <p>I am trying to define a HashMap as a bean on blueprint xml. The original problem is that I have </p>
  
  <pre><code>&lt;bean id="class1" class="com.acme.Class1"&gt;
    &lt;property name="acmeMap"&gt;
      &lt;map&gt;
        &lt;entry-key="coyotte" value="Poor Fellow"/&gt;
        &lt;entry-key="roadRunner" value="Sadistic Bird"/&gt;
      &lt;/map&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and it works well. Problem is when I have also another class which extends Class1, for example Class1a, on the same blueprint xml file.</p>
  
  <pre><code>&lt;bean id="class1a" class="com.acme.Class1a"&gt;
    &lt;property name="acmeMap"&gt;
      &lt;map&gt;
        &lt;entry-key="coyotte" value="Poor Fellow"/&gt;
        &lt;entry-key="roadRunner" value="Sadistic Bird"/&gt;
      &lt;/map&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This means defining the map twice and having to maintain it on the blueprint xml. Is there no way to instantiate, for example, something like</p>
  
  <pre><code> &lt;bean id="acmeMap" class="java.util.HashMap"/&gt; 
  </code></pre>
  
  <p>and initialize it with the values I need and then import the reference on the other beans? That would mean acmeMap is only created once. I did search for examples of initializing blueprint bean maps on the internet and can't find one. Or maybe the solution is something else?</p>