title: Spring enums in a map
body: <p>I have two enumerateds:</p>
  
  <pre><code>public enum One implements Representable{
     ONE
  }
  public enum Two implements Representable{
     TWO
  }
  </code></pre>
  
  <p>Now, I need to declare the following spring-bean:</p>
  
  <pre><code>&lt;bean id="listGeneratorContainer" class="pack.age.Container&gt;
      &lt;property name="generators"&gt;
          &lt;map key-type="pack.age.Representable"&gt; &lt;!-- How to specuify the Type? --&gt;
              &lt;entry key="ONE" value="1"/&gt;
              &lt;entry key="TWO" value="2"/&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>where</p>
  
  <pre><code>package pack.age;
  
  public class Container{
      private Map&lt;Representable, Interger&gt; generators
      //GET, SET, staff
  }
  </code></pre>
  
  <p>Is it possible to tell spring to inject enums of the different types? In the case of a single enum that's clear.</p>
  
  <p>It's not working now:</p>
  
  <pre><code> java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [pack.age.Representable]: no matching editors or conversion strategy found
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:219)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:107)
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:362)
      ... 34 more
  </code></pre>