## Uses of Class
javax.ws.rs.core.MediaType

- Packages that use MediaType
  Package | Description
  --- | ---
  javax.ws.rs.client | The JAX-RS client API
  javax.ws.rs.container | Container-specific JAX-RS API.
  javax.ws.rs.core | Low-level interfaces and annotations used to create RESTful service resources.
  javax.ws.rs.ext | APIs that provide extensions to the types supported by the JAX-RS API.

- - ### Uses of MediaType in javax.ws.rs.client

    Methods in javax.ws.rs.client that return MediaType
    Modifier and Type | Method and Description
    --- | ---
    `MediaType` | Entity.`getMediaType()` Get entity media type.
    `MediaType` | ClientResponseContext.`getMediaType()` Get the media type of the entity.
    `MediaType` | ClientRequestContext.`getMediaType()` Get the media type of the entity.

    Methods in javax.ws.rs.client that return types with arguments of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `List<MediaType>` | ClientRequestContext.`getAcceptableMediaTypes()` Get a list of media types that are acceptable for the response.

    Methods in javax.ws.rs.client with parameters of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `Invocation.Builder` | Invocation.Builder.`accept(MediaType... mediaTypes)` Add the accepted response media types.
    `static <T> Entity<T>` | Entity.`entity(T entity, MediaType mediaType)` Create an entity using a supplied content media type.
    `static <T> Entity<T>` | Entity.`entity(T entity, MediaType mediaType, Annotation[] annotations)` Create an entity using a supplied content media type.
    `Invocation.Builder` | WebTarget.`request(MediaType... acceptedResponseTypes)` Start building a request to the targeted web resource and define the accepted response media types.
    `void` | ClientRequestContext.`setEntity(Object entity, Annotation[] annotations, MediaType mediaType)` Set a new message entity, including the attached annotations and the media type.

  - ### Uses of MediaType in javax.ws.rs.container

    Methods in javax.ws.rs.container that return MediaType
    Modifier and Type | Method and Description
    --- | ---
    `MediaType` | ContainerResponseContext.`getMediaType()` Get the media type of the entity.
    `MediaType` | ContainerRequestContext.`getMediaType()` Get the media type of the entity.

    Methods in javax.ws.rs.container that return types with arguments of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `List<MediaType>` | ContainerRequestContext.`getAcceptableMediaTypes()` Get a list of media types that are acceptable for the response.

    Methods in javax.ws.rs.container with parameters of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `void` | ContainerResponseContext.`setEntity(Object entity, Annotation[] annotations, MediaType mediaType)` Set a new message entity, including the attached annotations and the media type.

  - ### Uses of MediaType in javax.ws.rs.core

    Fields in javax.ws.rs.core declared as MediaType
    Modifier and Type | Field and Description
    --- | ---
    `static MediaType` | MediaType.`APPLICATION_ATOM_XML_TYPE` A `MediaType` constant representing "application/atom+xml" media type.
    `static MediaType` | MediaType.`APPLICATION_FORM_URLENCODED_TYPE` A `MediaType` constant representing "application/x-www-form-urlencoded" media type.
    `static MediaType` | MediaType.`APPLICATION_JSON_TYPE` A `MediaType` constant representing "application/json" media type.
    `static MediaType` | MediaType.`APPLICATION_OCTET_STREAM_TYPE` A `MediaType` constant representing "application/octet-stream" media type.
    `static MediaType` | MediaType.`APPLICATION_SVG_XML_TYPE` A `MediaType` constant representing "application/svg+xml" media type.
    `static MediaType` | MediaType.`APPLICATION_XHTML_XML_TYPE` A `MediaType` constant representing "application/xhtml+xml" media type.
    `static MediaType` | MediaType.`APPLICATION_XML_TYPE` A `MediaType` constant representing "application/xml" media type.
    `static MediaType` | MediaType.`MULTIPART_FORM_DATA_TYPE` A `MediaType` constant representing "multipart/form-data" media type.
    `static MediaType` | MediaType.`TEXT_HTML_TYPE` A `MediaType` constant representing "text/html" media type.
    `static MediaType` | MediaType.`TEXT_PLAIN_TYPE` A `MediaType` constant representing "text/plain" media type.
    `static MediaType` | MediaType.`TEXT_XML_TYPE` A `MediaType` constant representing "text/xml" media type.
    `static MediaType` | MediaType.`WILDCARD_TYPE` A `MediaType` constant representing wildcard "*/*" media type.

    Methods in javax.ws.rs.core that return MediaType
    Modifier and Type | Method and Description
    --- | ---
    `MediaType` | Variant.`getMediaType()` Get the media type of the variant.
    `abstract MediaType` | Response.`getMediaType()` Get the media type of the message entity.
    `MediaType` | HttpHeaders.`getMediaType()` Get the media type of the request entity.
    `static MediaType` | MediaType.`valueOf(String type)` Creates a new instance of `MediaType` by parsing the supplied string.
    `MediaType` | MediaType.`withCharset(String charset)` Create a new `MediaType` instance with the same type, subtype and parameters copied from the original instance and the supplied "charset" parameter.

    Methods in javax.ws.rs.core that return types with arguments of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `List<MediaType>` | HttpHeaders.`getAcceptableMediaTypes()` Get a list of media types that are acceptable for the response.

    Methods in javax.ws.rs.core with parameters of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | MediaType.`isCompatible(MediaType other)` Check if this media type is compatible with another media type.
    `static Variant.VariantListBuilder` | Variant.`mediaTypes(MediaType... mediaTypes)` Create a `Variant.VariantListBuilder` initialized with a set of supported media types.
    `abstract Variant.VariantListBuilder` | Variant.VariantListBuilder.`mediaTypes(MediaType... mediaTypes)` Set the media type(s) for this variant.
    `static Response.ResponseBuilder` | Response.`ok(Object entity, MediaType type)` Create a new ResponseBuilder that contains a representation.
    `abstract Response.ResponseBuilder` | Response.ResponseBuilder.`type(MediaType type)` Set the message entity media type.

    Constructors in javax.ws.rs.core with parameters of type MediaType
    Constructor and Description
    `Variant(MediaType mediaType, Locale language, String encoding)` Create a new instance of Variant.
    `Variant(MediaType mediaType, String language, String encoding)` Create a new instance of Variant.
    `Variant(MediaType mediaType, String language, String country, String encoding)` Create a new instance of Variant.
    `Variant(MediaType mediaType, String language, String country, String languageVariant, String encoding)` Create a new instance of Variant.

  - ### Uses of MediaType in javax.ws.rs.ext

    Methods in javax.ws.rs.ext that return MediaType
    Modifier and Type | Method and Description
    --- | ---
    `MediaType` | InterceptorContext.`getMediaType()` Get media type of HTTP entity.

    Methods in javax.ws.rs.ext with parameters of type MediaType
    Modifier and Type | Method and Description
    --- | ---
    `<T> ContextResolver<T>` | Providers.`getContextResolver(Class<T> contextType, MediaType mediaType)` Get a context resolver for a particular type of context and media type.
    `<T> MessageBodyReader<T>` | Providers.`getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Get a message body reader that matches a set of criteria.
    `<T> MessageBodyWriter<T>` | Providers.`getMessageBodyWriter(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Get a message body writer that matches a set of criteria.
    `long` | MessageBodyWriter.`getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Originally, the method has been called before `writeTo` to ascertain the length in bytes of the serialized form of `t`.
    `boolean` | MessageBodyReader.`isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyReader can produce an instance of a particular type.
    `boolean` | MessageBodyWriter.`isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyWriter supports a particular type.
    `T` | MessageBodyReader.`readFrom(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)` Read a type from the `InputStream`.
    `void` | InterceptorContext.`setMediaType(MediaType mediaType)` Update media type of HTTP entity.
    `void` | MessageBodyWriter.`writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)` Write a type to an HTTP message.

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.