private ObjectMapper getObjectMapper ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; AnnotationIntrospector primary = new JacksonAnnotationIntrospector ( ) ; AnnotationIntrospector secondary = new JaxbAnnotationIntrospector ( ) ; AnnotationIntrospector pair = new AnnotationIntrospectorPair ( primary , secondary ) ; mapper . setAnnotationIntrospector ( pair ) ; mapper . setSerializationInclusion ( Include . NON_NULL ) ; return mapper ; }
Method to get the Jackson object mapper