Class MediaTypeProvider
- java.lang.Object
-
- org.glassfish.jersey.message.internal.MediaTypeProvider
-
- All Implemented Interfaces:
RuntimeDelegate.HeaderDelegate<MediaType>,HeaderDelegateProvider<MediaType>
@Singleton public class MediaTypeProvider extends Object implements HeaderDelegateProvider<MediaType>
Header delegate provider for MediaType.- Author:
- Marc Hadley, Marek Potociar, Martin Matula
-
-
Constructor Summary
Constructors Constructor Description MediaTypeProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaTypefromString(String header)booleansupports(Class<?> type)Ascertain if the Provider supports a particular type.StringtoString(MediaType header)static MediaTypevalueOf(HttpHeaderReader reader)Create a newMediaTypeinstance from a header reader.
-
-
-
Method Detail
-
supports
public boolean supports(Class<?> type)
Description copied from interface:HeaderDelegateProviderAscertain if the Provider supports a particular type.- Specified by:
supportsin interfaceHeaderDelegateProvider<MediaType>- Parameters:
type- the type that is to be supported.- Returns:
- true if the type is supported, otherwise false.
-
toString
public String toString(MediaType header)
- Specified by:
toStringin interfaceRuntimeDelegate.HeaderDelegate<MediaType>
-
fromString
public MediaType fromString(String header)
- Specified by:
fromStringin interfaceRuntimeDelegate.HeaderDelegate<MediaType>
-
valueOf
public static MediaType valueOf(HttpHeaderReader reader) throws ParseException
Create a newMediaTypeinstance from a header reader.- Parameters:
reader- header reader.- Returns:
- new
MediaTypeinstance. - Throws:
ParseException- in case of a header parsing error.
-
-