private List<HttpMessageConverter<?>> potentiallyRegisterModule(
        List<HttpMessageConverter<?>> converters) {

      for (HttpMessageConverter<?> converter : converters) {
        if (converter instanceof MappingJackson2HttpMessageConverter) {
          MappingJackson2HttpMessageConverter halConverterCandidate =
              (MappingJackson2HttpMessageConverter) converter;
          ObjectMapper objectMapper = halConverterCandidate.getObjectMapper();
          if (Jackson2HalModule.isAlreadyRegisteredIn(objectMapper)) {
            return converters;
          }
        }
      }

      CurieProvider curieProvider = getCurieProvider(beanFactory);
      RelProvider relProvider =
          beanFactory.getBean(DELEGATING_REL_PROVIDER_BEAN_NAME, RelProvider.class);
      ObjectMapper halObjectMapper =
          beanFactory.getBean(HAL_OBJECT_MAPPER_BEAN_NAME, ObjectMapper.class);
      MessageSourceAccessor linkRelationMessageSource =
          beanFactory.getBean(MESSAGE_SOURCE_BEAN_NAME, MessageSourceAccessor.class);

      halObjectMapper.registerModule(new Jackson2HalModule());
      halObjectMapper.setHandlerInstantiator(
          new Jackson2HalModule.HalHandlerInstantiator(
              relProvider, curieProvider, linkRelationMessageSource));

      MappingJackson2HttpMessageConverter halConverter =
          new TypeConstrainedMappingJackson2HttpMessageConverter(ResourceSupport.class);
      halConverter.setSupportedMediaTypes(Arrays.asList(HAL_JSON));
      halConverter.setObjectMapper(halObjectMapper);

      List<HttpMessageConverter<?>> result =
          new ArrayList<HttpMessageConverter<?>>(converters.size());
      result.add(halConverter);
      result.addAll(converters);
      return result;
    }
  /**
   * Configure an existing {@link ObjectMapper} instance with this builder's settings. This can be
   * applied to any number of {@code ObjectMappers}.
   *
   * @param objectMapper the ObjectMapper to configure
   */
  @SuppressWarnings("deprecation")
  public void configure(ObjectMapper objectMapper) {
    Assert.notNull(objectMapper, "ObjectMapper must not be null");

    if (this.findModulesViaServiceLoader) {
      // Jackson 2.2+
      objectMapper.registerModules(ObjectMapper.findModules(this.moduleClassLoader));
    } else if (this.findWellKnownModules) {
      registerWellKnownModulesIfAvailable(objectMapper);
    }

    if (this.modules != null) {
      for (Module module : this.modules) {
        // Using Jackson 2.0+ registerModule method, not Jackson 2.2+ registerModules
        objectMapper.registerModule(module);
      }
    }
    if (this.moduleClasses != null) {
      for (Class<? extends Module> module : this.moduleClasses) {
        objectMapper.registerModule(BeanUtils.instantiate(module));
      }
    }

    if (this.dateFormat != null) {
      objectMapper.setDateFormat(this.dateFormat);
    }
    if (this.locale != null) {
      objectMapper.setLocale(this.locale);
    }
    if (this.timeZone != null) {
      objectMapper.setTimeZone(this.timeZone);
    }

    if (this.annotationIntrospector != null) {
      objectMapper.setAnnotationIntrospector(this.annotationIntrospector);
    }
    if (this.propertyNamingStrategy != null) {
      objectMapper.setPropertyNamingStrategy(this.propertyNamingStrategy);
    }
    if (this.serializationInclusion != null) {
      objectMapper.setSerializationInclusion(this.serializationInclusion);
    }

    if (this.filters != null) {
      // Deprecated as of Jackson 2.6, but just in favor of a fluent variant.
      objectMapper.setFilters(this.filters);
    }

    for (Class<?> target : this.mixIns.keySet()) {
      // Deprecated as of Jackson 2.5, but just in favor of a fluent variant.
      objectMapper.addMixInAnnotations(target, this.mixIns.get(target));
    }

    if (!this.serializers.isEmpty() || !this.deserializers.isEmpty()) {
      SimpleModule module = new SimpleModule();
      addSerializers(module);
      addDeserializers(module);
      objectMapper.registerModule(module);
    }

    customizeDefaultFeatures(objectMapper);
    for (Object feature : this.features.keySet()) {
      configureFeature(objectMapper, feature, this.features.get(feature));
    }

    if (this.handlerInstantiator != null) {
      objectMapper.setHandlerInstantiator(this.handlerInstantiator);
    } else if (this.applicationContext != null) {
      objectMapper.setHandlerInstantiator(
          new SpringHandlerInstantiator(this.applicationContext.getAutowireCapableBeanFactory()));
    }
  }