View Javadoc
1   package fr.paris.lutece.plugins.aot.modules.declarationimmat.utils;
2   
3   import com.fasterxml.jackson.annotation.JsonInclude.Include;
4   import com.fasterxml.jackson.databind.AnnotationIntrospector;
5   import com.fasterxml.jackson.databind.DeserializationFeature;
6   import com.fasterxml.jackson.databind.ObjectMapper;
7   import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
8   import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
9   
10  public class JaxbJacksonObjectMapper extends ObjectMapper
11  {
12  
13      public JaxbJacksonObjectMapper( )
14      {
15          super( );
16  
17          this.configure( DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true );
18          this.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false );
19  
20          this.setSerializationInclusion( Include.NON_NULL );
21  
22          this.setAnnotationIntrospector( AnnotationIntrospector.pair( new JacksonAnnotationIntrospector( ), new JaxbAnnotationIntrospector( this.getTypeFactory( ) ) ) );
23  
24      }
25  }