Search in sources :

Example 1 with Pair

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);
}
Also used : JacksonAnnotationIntrospector(org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector) JacksonAnnotationIntrospector(org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector) JaxbAnnotationIntrospector(org.codehaus.jackson.xc.JaxbAnnotationIntrospector) AnnotationIntrospector(org.codehaus.jackson.map.AnnotationIntrospector) JaxbAnnotationIntrospector(org.codehaus.jackson.xc.JaxbAnnotationIntrospector) Pair(org.codehaus.jackson.map.AnnotationIntrospector.Pair)

Example 2 with Pair

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;
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Pair(org.codehaus.jackson.map.AnnotationIntrospector.Pair)

Aggregations

Pair (org.codehaus.jackson.map.AnnotationIntrospector.Pair)2 AnnotationIntrospector (org.codehaus.jackson.map.AnnotationIntrospector)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 JacksonAnnotationIntrospector (org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector)1 JaxbAnnotationIntrospector (org.codehaus.jackson.xc.JaxbAnnotationIntrospector)1