[Jersey] _at_XmlEnumValue is not recognized by Jackson

From: Pengfei Di <>
Date: Wed, 6 Apr 2011 16:00:44 +0200


I am trying to write a JAXB class, that constains a field of enum type,
into JSON String. I tried with @XmlEnumValue annotation, but it doesn't
take effect.
The JAXB class looks like:

public class MyClass {

     public enum MyEnum {
         @XmlEnumValue("1") INACTIVE,
         @XmlEnumValue("2") ACTIVE

     private MyEnum myEnum;

     public getMyEnum(){
         return myEnum;
     // setter

The expected JSON string is : {"myEnum":2}
But what I get is : {"myEnum":"ACTIVE"}

Does Jackson support this @XmlEnum annotation? or did I do something wrong?

Thanks a lot for any help.