use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector in project platformlayer by platformlayer.
the class JsonHelper method buildObjectMapper.
public static ObjectMapper buildObjectMapper(TypeFactory typeFactory, boolean formatted) {
ObjectMapper mapper = new ObjectMapper();
if (typeFactory == null) {
typeFactory = TypeFactory.defaultInstance();
}
if (formatted) {
mapper.enable(SerializationFeature.INDENT_OUTPUT);
}
// Favor JAXB annotations
AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector(typeFactory);
AnnotationIntrospector jacksonIntrospector = new JacksonAnnotationIntrospector();
AnnotationIntrospector introspector = new AnnotationIntrospectorPair(jaxbIntrospector, jacksonIntrospector);
mapper.setAnnotationIntrospector(introspector);
return mapper;
}
use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector in project midpoint by Evolveum.
the class JsonLexicalProcessor method configureMapperForSerialization.
private ObjectMapper configureMapperForSerialization() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
mapper.setSerializationInclusion(Include.NON_NULL);
mapper.registerModule(createSerializerModule());
mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector());
return mapper;
}
Aggregations