Class CombinedMediaType
- java.lang.Object
-
- org.glassfish.jersey.server.internal.routing.CombinedMediaType
-
final class CombinedMediaType extends java.lang.ObjectRepresents function S as defined in the Request Matching part of the spec.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classCombinedMediaType.EffectiveMediaTypeMedia typeextended by flag indicating whether media type was obtained from user annotationsConsumesorProducesor has no annotation and therefore was derived fromMessageBodyWorkers.
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.ws.rs.core.MediaTypecombinedTypeCombined client/server media type, stripped of q and qs parameters.(package private) static java.util.Comparator<CombinedMediaType>COMPARATORComparator used to compareCombinedMediaType.(package private) intdDistance of the combined media types.(package private) static CombinedMediaTypeNO_MATCHConstant combined type representing no match.(package private) intqClient-specified media type quality.(package private) intqsServer-specified media type quality.
-
Constructor Summary
Constructors Modifier Constructor Description privateCombinedMediaType(javax.ws.rs.core.MediaType combinedType, int q, int qs, int d)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intb2i(boolean b)(package private) static CombinedMediaTypecreate(javax.ws.rs.core.MediaType clientType, CombinedMediaType.EffectiveMediaType serverType)Create combined client/server media type.private static intmatchedWildcards(javax.ws.rs.core.MediaType clientMt, CombinedMediaType.EffectiveMediaType serverMt)java.lang.StringtoString()
-
-
-
Field Detail
-
NO_MATCH
static final CombinedMediaType NO_MATCH
Constant combined type representing no match.
-
combinedType
final javax.ws.rs.core.MediaType combinedType
Combined client/server media type, stripped of q and qs parameters.
-
q
final int q
Client-specified media type quality.
-
qs
final int qs
Server-specified media type quality.
-
d
final int d
Distance of the combined media types.- 0 - if the type and subtype of both combined media types match exactly (i.e. ["m/n" + "m/n"]).
- 1 - if one media type contains a wildcard type or subtype value that matches a concrete type or subtype value.
-
2 - if one of the media types is a
MediaType.WILDCARD_TYPEand the other one is a concrete media type.
-
COMPARATOR
static final java.util.Comparator<CombinedMediaType> COMPARATOR
Comparator used to compareCombinedMediaType. The comparator sorts the elements of list in the ascending order from the most appropriate to the least appropriate combined media type.
-
-
Method Detail
-
matchedWildcards
private static int matchedWildcards(javax.ws.rs.core.MediaType clientMt, CombinedMediaType.EffectiveMediaType serverMt)
-
b2i
private static int b2i(boolean b)
-
create
static CombinedMediaType create(javax.ws.rs.core.MediaType clientType, CombinedMediaType.EffectiveMediaType serverType)
Create combined client/server media type. if the two types are not compatible,NO_MATCHis returned.- Parameters:
clientType- client-side media type.serverType- server-side media type.- Returns:
- combined client/server media type.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-