Class AbstractHttpMessageConverter<T>

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
Type Parameters:
T - the converted object type
All Implemented Interfaces:
HttpMessageConverter<T>
Direct Known Subclasses:
AbstractGenericHttpMessageConverter, AbstractWireFeedHttpMessageConverter, AbstractXmlHttpMessageConverter, ByteArrayHttpMessageConverter, ObjectToStringHttpMessageConverter, ProtobufHttpMessageConverter, ResourceHttpMessageConverter, SourceHttpMessageConverter, StringHttpMessageConverter

public abstract class AbstractHttpMessageConverter<T> extends Object implements HttpMessageConverter<T>
Abstract base class for most HttpMessageConverter implementations.

This base class adds support for setting supported MediaTypes, through the supportedMediaTypes bean property. It also adds support for Content-Type and Content-Length when writing to output messages.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller, Sebastien Deleuze
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
      Logger available to subclasses.
  • Constructor Details

    • AbstractHttpMessageConverter

      protected AbstractHttpMessageConverter()
      Construct an AbstractHttpMessageConverter with no supported media types.
      See Also:
    • AbstractHttpMessageConverter

      protected AbstractHttpMessageConverter(MediaType supportedMediaType)
      Construct an AbstractHttpMessageConverter with one supported media type.
      Parameters:
      supportedMediaType - the supported media type
    • AbstractHttpMessageConverter

      protected AbstractHttpMessageConverter(MediaType... supportedMediaTypes)
      Construct an AbstractHttpMessageConverter with multiple supported media types.
      Parameters:
      supportedMediaTypes - the supported media types
    • AbstractHttpMessageConverter

      protected AbstractHttpMessageConverter(Charset defaultCharset, MediaType... supportedMediaTypes)
      Construct an AbstractHttpMessageConverter with a default charset and multiple supported media types.
      Parameters:
      defaultCharset - the default character set
      supportedMediaTypes - the supported media types
      Since:
      4.3
  • Method Details