I have an @XmlEnumValue in a generated class and I want to test a JSON mesage (I will pass in JSON message the value that must be mapped to @XmlEnumValue) and see if my value is getting mapped. But I am unable to do this.I Solved a similar problem to read @XmlElement by adding below code. Id there any similar approach for supporting @XmlEnumValue also ??? I am looking for such annotaion property name..
<bean id="jaxbAnnotationInspector"
class="org.codehaus.jackson.xc.JaxbAnnotationIntrospector"/>
<bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper">
<property name="annotationIntrospector" ref="jaxbAnnotationInspector"/>
</bean>
We're using such configuration to get it working
@Bean
public ObjectMapper objectMapper()
{
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JaxbAnnotationModule());
return objectMapper;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With