@Singleton public class MediaTypeProvider extends Object implements HeaderDelegateProvider<MediaType>
| Constructor and Description |
|---|
MediaTypeProvider() |
| Modifier and Type | Method and Description |
|---|---|
MediaType |
fromString(String header)
Parse the supplied value and create an instance of
T. |
boolean |
supports(Class<?> type)
Ascertain if the Provider supports a particular type.
|
String |
toString(MediaType header)
Convert the supplied value to a String.
|
static MediaType |
valueOf(HttpHeaderReader reader)
Create a new
MediaType instance from a header reader. |
public boolean supports(Class<?> type)
HeaderDelegateProvidersupports in interface HeaderDelegateProvider<MediaType>type - the type that is to be supported.public String toString(MediaType header)
RuntimeDelegate.HeaderDelegatetoString in interface RuntimeDelegate.HeaderDelegate<MediaType>header - the value of type T.public MediaType fromString(String header)
RuntimeDelegate.HeaderDelegateT.fromString in interface RuntimeDelegate.HeaderDelegate<MediaType>header - the string value.T.public static MediaType valueOf(HttpHeaderReader reader) throws ParseException
MediaType instance from a header reader.reader - header reader.MediaType instance.ParseException - in case of a header parsing error.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.