public class MediaTypes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static MediaType |
FAST_INFOSET |
static AcceptableMediaType |
GENERAL_ACCEPT_MEDIA_TYPE
The general acceptable media type corresponding to \*\/*.
|
static java.util.List<AcceptableMediaType> |
GENERAL_ACCEPT_MEDIA_TYPE_LIST
A singleton list containing the general acceptable media type.
|
static MediaType |
GENERAL_MEDIA_TYPE
The general media type corresponding to \*\/*.
|
static java.util.List<MediaType> |
GENERAL_MEDIA_TYPE_LIST
A singleton list containing the general media type.
|
static java.util.List<MediaType> |
GENERAL_QUALITY_SOURCE_MEDIA_TYPE_LIST
A singleton list containing the general media type.
|
static java.util.Comparator<MediaType> |
MEDIA_TYPE_COMPARATOR
Comparator for media types.
|
static java.util.Comparator<java.util.List<? extends MediaType>> |
MEDIA_TYPE_LIST_COMPARATOR
Comparator for lists of media types.
|
static java.util.Comparator<QualitySourceMediaType> |
QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR
Comparator for lists of quality source media types.
|
static MediaType |
WADL |
static MediaType |
WADL_JSON |
static java.lang.String |
WADL_JSON_STRING |
static java.lang.String |
WADL_STRING |
Modifier and Type | Method and Description |
---|---|
static java.util.List<MediaType> |
createMediaTypes(Consumes mime)
Create a list of media type from the
Consumes annotation. |
static java.util.List<MediaType> |
createMediaTypes(Produces mime)
Create a list of media type from the Produces annotation.
|
static java.util.List<MediaType> |
createMediaTypes(java.lang.String[] mediaTypes)
Create a list of media type from an array of media types.
|
static java.util.List<MediaType> |
createQualitySourceMediaTypes(Produces mime)
Create a list of quality source media type from the Produces annotation.
|
static java.util.List<QualitySourceMediaType> |
createQualitySourceMediaTypes(java.lang.String[] mediaTypes)
Create a list of quality source media type from an array of media types.
|
static MediaType |
getTypeWildCart(MediaType mediaType)
Returns MediaType with wildcard in subtype.
|
static boolean |
intersects(java.util.List<? extends MediaType> ml1,
java.util.List<? extends MediaType> ml2) |
static MediaType |
mostSpecific(MediaType m1,
MediaType m2)
Get the most specific media type from a pair of media types.
|
static boolean |
typeEquals(MediaType m1,
MediaType m2) |
public static final java.lang.String WADL_STRING
public static final MediaType WADL
public static final java.lang.String WADL_JSON_STRING
public static final MediaType WADL_JSON
public static final MediaType FAST_INFOSET
public static final java.util.Comparator<MediaType> MEDIA_TYPE_COMPARATOR
x/y < x/* < \*\/*
public static final java.util.Comparator<java.util.List<? extends MediaType>> MEDIA_TYPE_LIST_COMPARATOR
The least specific content type of each list is obtained and then compared
using MEDIA_TYPE_COMPARATOR
.
Assumes each list is already ordered according to MEDIA_TYPE_COMPARATOR
and therefore the least specific media type is at the end of the list.
public static final MediaType GENERAL_MEDIA_TYPE
public static final java.util.List<MediaType> GENERAL_MEDIA_TYPE_LIST
public static final AcceptableMediaType GENERAL_ACCEPT_MEDIA_TYPE
public static final java.util.List<AcceptableMediaType> GENERAL_ACCEPT_MEDIA_TYPE_LIST
public static final java.util.Comparator<QualitySourceMediaType> QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR
public static final java.util.List<MediaType> GENERAL_QUALITY_SOURCE_MEDIA_TYPE_LIST
public static final boolean intersects(java.util.List<? extends MediaType> ml1, java.util.List<? extends MediaType> ml2)
public static final MediaType mostSpecific(MediaType m1, MediaType m2)
m1
- the first media typem2
- the second media typepublic static java.util.List<MediaType> createMediaTypes(Consumes mime)
Consumes
annotation.
mime
- the Consumes annotation.MediaType
, ordered according to MEDIA_TYPE_COMPARATOR
.public static java.util.List<MediaType> createMediaTypes(Produces mime)
mime
- the Produces annotation.MediaType
, ordered according to MEDIA_TYPE_COMPARATOR
.public static java.util.List<MediaType> createMediaTypes(java.lang.String[] mediaTypes)
mediaTypes
- the array of meda types.MediaType
, ordered according to MEDIA_TYPE_COMPARATOR
.public static java.util.List<MediaType> createQualitySourceMediaTypes(Produces mime)
mime
- the Produces annotation.QualitySourceMediaType
, ordered according to
QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR
.public static java.util.List<QualitySourceMediaType> createQualitySourceMediaTypes(java.lang.String[] mediaTypes)
mediaTypes
- the array of meda types.QualitySourceMediaType
, ordered according to
the quality source as the primary key and MEDIA_TYPE_COMPARATOR
as the secondary key.Copyright © 2016 Oracle Corporation. All Rights Reserved.