Interface ContentTypeResolver

All Known Implementing Classes:
DefaultContentTypeResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ContentTypeResolver
Resolve the content type for a message.
Since:
4.0
Author:
Rossen Stoyanchev
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.util.MimeType
    Determine the MimeType of a message from the given MessageHeaders.
  • Method Details

    • resolve

      @Nullable org.springframework.util.MimeType resolve(@Nullable MessageHeaders headers) throws org.springframework.util.InvalidMimeTypeException
      Determine the MimeType of a message from the given MessageHeaders.
      Parameters:
      headers - the headers to use for the resolution
      Returns:
      the resolved MimeType, or null if none found
      Throws:
      org.springframework.util.InvalidMimeTypeException - if the content type is a String that cannot be parsed
      IllegalArgumentException - if there is a content type but its type is unknown