public class JsonHttpMessageConverter extends org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
| 构造器和说明 |
|---|
JsonHttpMessageConverter() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
canRead(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
protected boolean |
canRead(org.springframework.http.MediaType mediaType) |
boolean |
canRead(Type type,
Class<?> contextClass,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
protected boolean |
canWrite(org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Type type,
Class<?> clazz,
org.springframework.http.MediaType mediaType) |
protected com.fasterxml.jackson.core.JsonEncoding |
getJsonEncoding(org.springframework.http.MediaType contentType) |
List<org.springframework.http.MediaType> |
getSupportedMediaTypes() |
Object |
read(Type type,
Class<?> aClass,
org.springframework.http.HttpInputMessage httpInputMessage)
反序列化
|
protected Object |
readInternal(Class<?> aClass,
org.springframework.http.HttpInputMessage httpInputMessage) |
protected boolean |
supports(Class<?> clazz) |
protected void |
writeInternal(Object object,
Type type,
org.springframework.http.HttpOutputMessage httpOutputMessage)
序列化
|
addDefaultHeaders, getContentLength, getDefaultCharset, getDefaultContentType, read, setDefaultCharset, setSupportedMediaTypes, writeprotected boolean supports(Class<?> clazz)
supports 在类中 org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>public boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
public boolean canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)
protected boolean canRead(org.springframework.http.MediaType mediaType)
canRead 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>public List<org.springframework.http.MediaType> getSupportedMediaTypes()
public boolean canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
public boolean canWrite(Type type, Class<?> clazz, org.springframework.http.MediaType mediaType)
protected boolean canWrite(org.springframework.http.MediaType mediaType)
canWrite 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>protected void writeInternal(Object object, Type type, org.springframework.http.HttpOutputMessage httpOutputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
writeInternal 在类中 org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>object - 对象type - 类型httpOutputMessage - 输出流IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionprotected Object readInternal(Class<?> aClass, org.springframework.http.HttpInputMessage httpInputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
readInternal 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionpublic Object read(Type type, Class<?> aClass, org.springframework.http.HttpInputMessage httpInputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
type - 参数类型aClass - Controller的类型httpInputMessage - 输入流IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionprotected com.fasterxml.jackson.core.JsonEncoding getJsonEncoding(@Nullable
org.springframework.http.MediaType contentType)
Copyright © 2021. All rights reserved.