1 package org.openecomp.mso.client.policy;
\r
3 import javax.ws.rs.ext.ContextResolver;
\r
5 import javax.ws.rs.ext.Provider;
\r
7 import com.fasterxml.jackson.annotation.JsonInclude.Include;
\r
8 import com.fasterxml.jackson.databind.DeserializationFeature;
\r
9 import com.fasterxml.jackson.databind.MapperFeature;
\r
10 import com.fasterxml.jackson.databind.ObjectMapper;
\r
11 import com.fasterxml.jackson.databind.SerializationFeature;
\r
14 public class CommonObjectMapperProvider implements ContextResolver<ObjectMapper> {
\r
16 final ObjectMapper mapper;
\r
18 public CommonObjectMapperProvider() {
\r
20 mapper = new ObjectMapper();
\r
21 mapper.setSerializationInclusion(Include.NON_NULL);
\r
22 mapper.enable(MapperFeature.USE_ANNOTATIONS);
\r
23 mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
\r
24 mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
\r
28 public ObjectMapper getContext(Class<?> type) {
\r