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 Summary
Modifier and TypeMethodDescriptionstatic MediaTypeRegistryCreates a default registry with application/json, application/multipart and text/plain mediatypes registered.static MediaTypeRegistryCreates an empty registry.Finds the registration for the provided media type.default booleanisSupported(String type) Checks if the provided media type is supported by the registrationregister(MediaTypeRegistration registration) Registers a new MediaTypeHandler
-
Method Details
-
createDefault
Creates a default registry with application/json, application/multipart and text/plain mediatypes registered.- Returns:
- A registry with default options.
-
createEmpty
-
register
Registers a new MediaTypeHandler- Parameters:
registration- The mediatype registration.- Returns:
- This registry for a fluent interface.
-
isSupported
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
-
get
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.
-