code: public static SimpleModule getModule(final ObjectMapper mapper) {
          SimpleModule module = new SimpleModule();
          module.setDeserializerModifier(new BeanDeserializerModifier() {
              @Override
              public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
                  if (BeanDeserializer.class.isAssignableFrom(deserializer.getClass())) {
                      // Apply flattening deserializer on all POJO types.
                      return new FlatteningDeserializer(beanDesc.getBeanClass(), deserializer, mapper);
                  } else {
                      return deserializer;
                  }
              }
          });
          return module;
      }
docs: Gets a module wrapping this serializer as an adapter for the Jackson
  ObjectMapper.
  
  @param mapper the object mapper for default deserializations
  @return a simple module to be plugged onto Jackson ObjectMapper.