title: How to inject a Jakarta enums in a Spring application context?
body: <p>I have a class which constructor takes a <a href="http://commons.apache.org/lang/api-2.3/org/apache/commons/lang/enums/Enum.html" rel="nofollow noreferrer">Jakarta enums</a>. I'm trying to find how I can easily inject it via an <a href="http://www.springframework.org/" rel="nofollow noreferrer">Spring</a> XML aplicationContext.</p>
  
  <p>For example :</p>
  
  <p>The enum :</p>
  
  <pre><code>public class MyEnum extends org.apache.commons.lang.enums.Enum {
      public static final MyEnum MY_FIRST_VALUE = new MyEnum("MyFirstValue");
      public static final MyEnum MY_SECOND_VALUE = new MyEnum("MySecondValue");
  
      public static MyEnum getEnum(String name) {
          return (MyEnum) getEnum(MyEnum.class, name);
      }
      [...other standard enum methods]
  }
  </code></pre>
  
  <p>The class in which to inject :</p>
  
  <pre><code>public class MyService {
      private final MyEnum status;
      public MyService(MyEnum status) {
          this.status = status;
      }
  }
  </code></pre>
  
  <p>The application context :</p>
  
  <pre><code>&lt;bean id="myService" class="MyService"&gt;
      &lt;constructor-arg index="0" value="MyFirstValue" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Of course, with this I have a <code>no matching editors or conversion strategy found</code> error. Is there an easy integration between Spring and the Jakarta enums ? Or should I write my own PropertyEditor ?</p>