Uses of Class
jakarta.ws.rs.core.MediaType
Package
Description
The JAX-RS client API
Container-specific JAX-RS API.
Low-level interfaces and annotations used to create RESTful service resources.
APIs that provide extensions to the types supported by the JAX-RS API.
Server-Sent Events related API.
-
Uses of MediaType in jakarta.ws.rs.client
Modifier and TypeMethodDescriptionClientRequestContext.getMediaType()
Get the media type of the entity.ClientResponseContext.getMediaType()
Get the media type of the entity.Entity.getMediaType()
Get entity media type.Modifier and TypeMethodDescriptionClientRequestContext.getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.Modifier and TypeMethodDescriptionAdd the accepted response media types.static <T> Entity<T>
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.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 jakarta.ws.rs.container
Modifier and TypeMethodDescriptionContainerRequestContext.getMediaType()
Get the media type of the entity.ContainerResponseContext.getMediaType()
Get the media type of the entity.Modifier and TypeMethodDescriptionContainerRequestContext.getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.Modifier and TypeMethodDescriptionvoid
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 jakarta.ws.rs.core
Modifier and TypeFieldDescriptionstatic final MediaType
MediaType.APPLICATION_ATOM_XML_TYPE
AMediaType
constant representing "application/atom+xml" media type.static final MediaType
MediaType.APPLICATION_FORM_URLENCODED_TYPE
AMediaType
constant representing "application/x-www-form-urlencoded" media type.static final MediaType
MediaType.APPLICATION_JSON_PATCH_JSON_TYPE
AMediaType
constant representing "application/json-patch+json" media type.static final MediaType
MediaType.APPLICATION_JSON_TYPE
AMediaType
constant representing "application/json" media type.static final MediaType
MediaType.APPLICATION_OCTET_STREAM_TYPE
AMediaType
constant representing "application/octet-stream" media type.static final MediaType
MediaType.APPLICATION_SVG_XML_TYPE
AMediaType
constant representing "application/svg+xml" media type.static final MediaType
MediaType.APPLICATION_XHTML_XML_TYPE
AMediaType
constant representing "application/xhtml+xml" media type.static final MediaType
MediaType.APPLICATION_XML_TYPE
AMediaType
constant representing "application/xml" media type.static final MediaType
MediaType.MULTIPART_FORM_DATA_TYPE
AMediaType
constant representing "multipart/form-data" media type.static final MediaType
MediaType.SERVER_SENT_EVENTS_TYPE
Server sent events media type.static final MediaType
MediaType.TEXT_HTML_TYPE
AMediaType
constant representing "text/html" media type.static final MediaType
MediaType.TEXT_PLAIN_TYPE
AMediaType
constant representing "text/plain" media type.static final MediaType
MediaType.TEXT_XML_TYPE
AMediaType
constant representing "text/xml" media type.static final MediaType
MediaType.WILDCARD_TYPE
Modifier and TypeMethodDescriptionEntityPart.getMediaType()
Returns the content type of this part, and equivalent to callingMediaType.valueOf(part.getHeaders().getFirst(HttpHeaders.CONTENT_TYPE))
.HttpHeaders.getMediaType()
Get the media type of the request entity.abstract MediaType
Response.getMediaType()
Get the media type of the message entity.Variant.getMediaType()
Get the media type of the variant.static MediaType
Creates a new instance ofMediaType
by parsing the supplied string.MediaType.withCharset
(String charset) Create a newMediaType
instance with the same type, subtype and parameters copied from the original instance and the supplied "charset" parameter.Modifier and TypeMethodDescriptionHttpHeaders.getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response.Modifier and TypeMethodDescriptionboolean
MediaType.isCompatible
(MediaType other) Check if this media type is compatible with another media type.Sets the media type for the EntityPart.static Variant.VariantListBuilder
Variant.mediaTypes
(MediaType... mediaTypes) Create aVariant.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
Create a new ResponseBuilder that contains a representation.abstract Response.ResponseBuilder
Set the message entity media type. -
Uses of MediaType in jakarta.ws.rs.ext
Modifier and TypeMethodDescriptionInterceptorContext.getMediaType()
Get media type of HTTP entity.Modifier and TypeMethodDescription<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.default long
MessageBodyWriter.getSize
(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) Originally, the method has been called beforewriteTo
to ascertain the length in bytes of the serialized form oft
.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.MessageBodyReader.readFrom
(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) Read a type from theInputStream
.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. -
Uses of MediaType in jakarta.ws.rs.sse
Modifier and TypeMethodDescriptionOutboundSseEvent.getMediaType()
Getmedia type
of the event data.Modifier and TypeMethodDescriptionSet themedia type
of the event data.<T> T
InboundSseEvent.readData
(GenericType<T> type, MediaType mediaType) Read event data as a given generic type.<T> T
Read event data as a given Java type.