GenericHttpMessageConverter implementations.
| Access | Constructor and Description |
|---|---|
| protected | AbstractGenericHttpMessageConverter()
Construct an |
| protected | AbstractGenericHttpMessageConverter(MediaType
the supported media type supportedMediaType)Construct an |
| protected | AbstractGenericHttpMessageConverter(MediaType...
the supported media types supportedMediaTypes)Construct an |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(Type
the (potentially generic) type to test for readability type, Class<?> a context class for the target type, for example a class
in which the target type appears in a method signature (can be contextClass, MediaType null)the media type to read, can be mediaType)null if not specified.
Typically, the value of a Content-Type header.Implements org. |
| public boolean | canWrite(Type
the (potentially generic) type to test for writability
(can be type, Class<?> null if not specified)the source object class to test for writability clazz, MediaType the media type to write (can be mediaType)null if not specified);
typically the value of an Accept header.Implements org. |
| protected boolean | supports(Class<?>
the class to test for support clazz)Implements abstract org. |
| public final void | write(final T
the object to write to the output message. The type of this object must
have previously been passed to the t, final Type canWrite method of this
interface, which must have returned true.the (potentially generic) type of object to write. This type must have
previously been passed to the type, MediaType canWrite method of this interface,
which must have returned true. Can be null if not specified.the content type to use when writing. May be contentType, HttpOutputMessage null to
indicate that the default content type of the converter must be used. If not
null, this media type must have previously been passed to the
canWrite method of this interface, which must have returned
true.the message to write to outputMessage)Implements org. addDefaultHeaders,
and then calls writeInternal.
|
| protected void | writeInternal(T
the object to write to the output message t, HttpOutputMessage the HTTP output message to write to outputMessage)Implements abstract org. |
| protected abstract void | writeInternal(T
the object to write to the output message t, Type the type of object to write (may be type, HttpOutputMessage null)the HTTP output message to write to outputMessage)Abstract template method that writes the actual body. |
| AbstractGenericHttpMessageConverter | back to summary |
|---|---|
| protected AbstractGenericHttpMessageConverter() Construct an
| |
| AbstractGenericHttpMessageConverter | back to summary |
|---|---|
| protected AbstractGenericHttpMessageConverter(MediaType supportedMediaType) Construct an
| |
| AbstractGenericHttpMessageConverter | back to summary |
|---|---|
| protected AbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes) Construct an
| |
| canRead | back to summary |
|---|---|
| public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) Implements org. Doc from org. Indicates whether the given type can be read by this converter.
This method should perform the same checks as
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) Implements org. Doc from org. Indicates whether the given class can be written by this converter. This method should perform the same checks as
| |
| supports | back to summary |
|---|---|
| protected boolean supports(Class<?> clazz) Implements abstract org. Doc from org. Indicates whether the given class is supported by this converter. | |
| write | back to summary |
|---|---|
| public final void write(final T t, final Type type, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Implements org. This implementation sets the default headers by calling
| |
| writeInternal | back to summary |
|---|---|
| protected void writeInternal(T t, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Implements abstract org. Doc from org. Abstract template method that writes the actual body. Invoked from
| |
| writeInternal | back to summary |
|---|---|
| protected abstract void writeInternal(T t, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Abstract template method that writes the actual body. Invoked from
| |