Interface MediaTypeRegistry


public interface MediaTypeRegistry
The MediaTypeRegistry contains all supported MediaTypes and Validators for the mediatypes. New MediaTypes can be registered by providing new MediaTypeRegistrations.
  • Method Details

    • createDefault

      static MediaTypeRegistry createDefault()
      Creates a default registry with application/json, application/multipart and text/plain mediatypes registered.
      Returns:
      A registry with default options.
    • createEmpty

      static MediaTypeRegistry createEmpty()
      Creates an empty registry.
      Returns:
      An empty registry.
    • register

      MediaTypeRegistry register(MediaTypeRegistration registration)
      Registers a new MediaTypeHandler
      Parameters:
      registration - The mediatype registration.
      Returns:
      This registry for a fluent interface.
    • isSupported

      default boolean isSupported(String type)
      Checks if the provided media type is supported by the registration
      Parameters:
      type - The raw mediatype string
      Returns:
      true if it supported, false otherwise
    • supportedTypes

      List<String> supportedTypes()
      Returns:
      A list of all supported types.
    • get

      MediaTypeRegistration get(String mediaType)
      Finds the registration for the provided media type.
      Parameters:
      mediaType - The media type to find the registration for.
      Returns:
      The registration if found, null otherwise.