Refine Jackson canEncode() / canDecode() implementation

This commit refine Jackson canEncode() / canDecode()
implementation by using ObjectMapper canSerialize() /
canDeserialize() methods.

Issue: SPR-14748
This commit is contained in:
Sebastien Deleuze
2016-09-27 21:57:17 +02:00
parent b91c0b3a1a
commit dbc86ec043
6 changed files with 19 additions and 15 deletions

View File

@@ -42,7 +42,7 @@ public interface Decoder<T> {
* Whether the decoder supports the given target element type and the MIME
* type of the source stream.
* @param elementType the target element type for the output stream
* @param mimeType the mime type associated with the stream to decode
* @param mimeType the mime type associated with the stream to decode, can be {@code null} if not specified.
* @return {@code true} if supported, {@code false} otherwise
*/
boolean canDecode(ResolvableType elementType, MimeType mimeType);

View File

@@ -43,7 +43,7 @@ public interface Encoder<T> {
* Whether the encoder supports the given source element type and the MIME
* type for the output stream.
* @param elementType the type of elements in the source stream
* @param mimeType the MIME type for the output stream
* @param mimeType the MIME type for the output stream, can be {@code null} if not specified.
* @return {@code true} if supported, {@code false} otherwise
*/
boolean canEncode(ResolvableType elementType, MimeType mimeType);