I am using jackson 2.4 + JaxbAnnotationModule
In some cases, I would like to apply an XMLJavaTypeAdapter to the jaxb object, for example the below:
@XmlJavaTypeAdapter(IntegerAdapter.class)
@XmlSchemaType(name = "int")
protected Integer favoriteNumber;
This is working well for the deserialization process. However, it seems that if I serialize the object containing this field to json, the result becomes a string instead of an integer
"favoriteNumber": "21"
Is there a way to serialize this value to an integer in json with jackson/jaxb while using an XmlJavaTypeAdapter?