public final class MediaTypeResolverImpl extends Object implements MediaTypeResolver
| Constructor and Description |
|---|
MediaTypeResolverImpl(Map<String,RequestReceiver> mediaTypeToHandler)
Constructor which accepts a mapping of media type to content handler.
|
| Modifier and Type | Method and Description |
|---|---|
RequestReceiver |
getHandler(String mediaType)
Returns a handler which is meant to process content of the specified
media type.
|
static MediaTypeResolver |
newJsonResolver(RequestReceiver jsonHandler)
Creates a resolver which processes only JSON content.
|
public MediaTypeResolverImpl(Map<String,RequestReceiver> mediaTypeToHandler)
mediaTypeToHandler - maps a media/MIME type to a content handlerpublic static MediaTypeResolver newJsonResolver(RequestReceiver jsonHandler)
jsonHandler - content handler; must not be nullpublic RequestReceiver getHandler(String mediaType)
MediaTypeResolvergetHandler in interface MediaTypeResolvermediaType - media/MIME type; for example application/json; must not
be nullnull if there is no matching
handlerCopyright © 2023. All rights reserved.