title: Inject the value of an enum into a property using spring
body: <p>I have an enum similar to the below</p>
  
  <pre><code>public enum MyEnum {
  ABC("some string"), 
  DEF("some string"), 
  GHI("another string");
  
  String value;
  
  private MyEnum(String value) {
      this.value = value;
  }
  
  public String value() {
      return this.value;
  }}
  </code></pre>
  
  <p>And I would like to make a util:map using the value of the enum as the key not the enum itself. So the map would look like this:</p>
  
  <pre><code>"some string" -&gt; "mapped output 1"
  "another string" -&gt; "mapped output 2"
  </code></pre>
  
  <p>I know I can use util:constant to get the enum but i need the value the enum represents.</p>
  
  <p>So my config file at the minute looks like this:</p>
  
  <pre><code>&lt;util:constant id="firstKey" static-field="package.MyEnum.ABC"/&gt;
  &lt;util:constant id="secondKey" static-field="package.MyEnum.GHI" /&gt;
  
  
  &lt;util:map id="myMap"&gt;
      &lt;entry key-ref="firstKey" value="mapped output 1" /&gt;
      &lt;entry key-ref="secondKey" value="mapped output 2" /&gt;&lt;/util:map&gt;
  </code></pre>
  
  <p>Is there a way I can get .value() or even get access to the value property to use it as the key?</p>
  
  <p>I tried declaring the key type to be string in the hope spring would work it out but it seems to have just ignored this. </p>
  
  <p>Using spring 2.5.1 and I cannot modify the enum</p>