T - Java type supported by the providerpublic interface MessageBodyReader<T>
MessageBodyReader implementation may be annotated
with Consumes to restrict the media types for which it will
be considered suitable.
Providers implementing MessageBodyReader contract must be either programmatically
registered in a JAX-RS runtime or must be annotated with
@Provider annotation to be automatically discovered
by the JAX-RS runtime during a provider scanning phase.
| Modifier and Type | Method and Description |
|---|---|
boolean |
isReadable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
MediaType mediaType)
Ascertain if the MessageBodyReader can produce an instance of a
particular type.
|
T |
readFrom(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<java.lang.String,java.lang.String> httpHeaders,
java.io.InputStream entityStream)
Read a type from the
InputStream. |
boolean isReadable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
MediaType mediaType)
type parameter gives the
class of the instance that should be produced, the genericType parameter
gives the java.lang.reflect.Type of the instance
that should be produced.
E.g. if the instance to be produced is List<String>, the type parameter
will be java.util.List and the genericType parameter will be
java.lang.reflect.ParameterizedType.type - the class of instance to be produced.genericType - the type of instance to be produced. E.g. if the
message body is to be converted into a method parameter, this will be
the formal type of the method parameter as returned by
Method.getGenericParameterTypes.ode> - java type foriv class="summary">
-
-
Method Summary
All Methods
MessageBodyReader
&nbsh&nbsh&nbshResponse.ResponseBuilder.replaceAll(((MediaType mediaType)
Ascertain if the MessageBodyReader can produce an instance of a
particular type. The type parameter gives the
clas clas clas clas clauce an insws/rs/co.ws.="text/css" href=(luedMsReadabletc script">
- Summary:
- Nestedeiref="clasnml" h
- Summary:
- Nestedeiref="clasnml" h
- Summary:
- Nestedeiref="clasnml" h
- Summary:
<">
- S~p;
genericType - the type of instance to be produced. E.g. if the
message body is to be converted intooduced. E.g. if the
message body is to be converted intooduced. E.g. if the
message body is to be converted intooduced. E.g. if the
e.html"
Convert&&ciref="clasnml" h to be piv>