Class ContentTypeDeterminer
- java.lang.Object
-
- org.glassfish.jersey.internal.routing.ContentTypeDeterminer
-
public class ContentTypeDeterminer extends Object
Utility class containing methods used on both client and server side for determining media type of a response based on providedMessageBodyWorkers.
-
-
Field Summary
Fields Modifier and Type Field Description protected MessageBodyWorkersworkers
-
Constructor Summary
Constructors Modifier Constructor Description protectedContentTypeDeterminer(MessageBodyWorkers workers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MediaTypedetermineResponseMediaType(Class<?> entityClass, Type entityType, RequestSpecificConsumesProducesAcceptor<?> selectedMethod, List<AcceptableMediaType> acceptableMediaTypes, List<MediaType> methodProducesTypes, Annotation[] handlingMethodAnnotations)
-
-
-
Field Detail
-
workers
protected MessageBodyWorkers workers
-
-
Constructor Detail
-
ContentTypeDeterminer
protected ContentTypeDeterminer(MessageBodyWorkers workers)
-
-
Method Detail
-
determineResponseMediaType
protected MediaType determineResponseMediaType(Class<?> entityClass, Type entityType, RequestSpecificConsumesProducesAcceptor<?> selectedMethod, List<AcceptableMediaType> acceptableMediaTypes, List<MediaType> methodProducesTypes, Annotation[] handlingMethodAnnotations)
Determine theMediaTypeof theResponsebased on writers suitable for the given entity class, pre-selected method and acceptable media types.- Parameters:
entityClass- entity class to determine the media type for.entityType- entity type for writers.selectedMethod- pre-selected (invoked) method.acceptableMediaTypes- acceptable media types from request.methodProducesTypes- media types producible by resource method- Returns:
- media type of the response.
-
-