use of org.codehaus.jackson.map.AnnotationIntrospector.Pair in project jersey by jersey.
the class MyObjectMapperProvider method createJaxbJacksonAnnotationIntrospector.
private static Pair createJaxbJacksonAnnotationIntrospector() {
final AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector();
final AnnotationIntrospector jacksonIntrospector = new JacksonAnnotationIntrospector();
return new AnnotationIntrospector.Pair(jacksonIntrospector, jaxbIntrospector);
}
use of org.codehaus.jackson.map.AnnotationIntrospector.Pair in project jersey by jersey.
the class MyObjectMapperProvider method createCombinedObjectMapper.
private static ObjectMapper createCombinedObjectMapper() {
final Pair combinedIntrospector = createJaxbJacksonAnnotationIntrospector();
final ObjectMapper result = new ObjectMapper();
result.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
result.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
result.setDeserializationConfig(result.getDeserializationConfig().withAnnotationIntrospector(combinedIntrospector));
result.setSerializationConfig(result.getSerializationConfig().withAnnotationIntrospector(combinedIntrospector));
return result;
}
Aggregations