Class 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 provided MessageBodyWorkers.
    • Constructor Detail

    • Method Detail

      • determineResponseMediaType

        protected MediaType determineResponseMediaType​(Class<?> entityClass,
                                                       Type entityType,
                                                       RequestSpecificConsumesProducesAcceptor<?> selectedMethod,
                                                       List<AcceptableMediaType> acceptableMediaTypes,
                                                       List<MediaType> methodProducesTypes,
                                                       Annotation[] handlingMethodAnnotations)
        Determine the MediaType of the Response based 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.