public class CustomFastJsonHttpMessageConverter extends org.springframework.http.converter.AbstractHttpMessageConverter<Object> implements org.springframework.http.converter.GenericHttpMessageConverter<Object>
Compatible Spring MVC version 3.2+
Supported return type:
Simple object: Object
With property filter :FastJsonContainer[Object]
Jsonp :MappingFastJsonValue[Object]
Jsonp with property filter: MappingFastJsonValue[FastJsonContainer[Object]]AbstractHttpMessageConverter,
GenericHttpMessageConverter| 限定符和类型 | 字段和说明 |
|---|---|
static org.springframework.http.MediaType |
APPLICATION_JAVASCRIPT |
protected String |
dateFormat
已过时。
|
protected com.alibaba.fastjson.serializer.SerializerFeature[] |
features
已过时。
|
protected com.alibaba.fastjson.serializer.SerializeFilter[] |
filters
已过时。
|
| 构造器和说明 |
|---|
CustomFastJsonHttpMessageConverter()
Can serialize/deserialize all types.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addSerializeFilter(com.alibaba.fastjson.serializer.SerializeFilter filter)
已过时。
|
boolean |
canRead(Type type,
Class<?> contextClass,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Type type,
Class<?> clazz,
org.springframework.http.MediaType mediaType) |
Charset |
getCharset()
已过时。
|
String |
getDateFormat()
已过时。
|
com.alibaba.fastjson.support.config.FastJsonConfig |
getFastJsonConfig() |
com.alibaba.fastjson.serializer.SerializerFeature[] |
getFeatures()
已过时。
|
com.alibaba.fastjson.serializer.SerializeFilter[] |
getFilters()
已过时。
|
protected Type |
getType(Type type,
Class<?> contextClass) |
Object |
read(Type type,
Class<?> contextClass,
org.springframework.http.HttpInputMessage inputMessage) |
protected Object |
readInternal(Class<? extends Object> clazz,
org.springframework.http.HttpInputMessage inputMessage) |
void |
setCharset(Charset charset)
已过时。
|
void |
setDateFormat(String dateFormat)
已过时。
|
void |
setFastJsonConfig(com.alibaba.fastjson.support.config.FastJsonConfig fastJsonConfig) |
void |
setFeatures(com.alibaba.fastjson.serializer.SerializerFeature... features)
已过时。
|
void |
setFilters(com.alibaba.fastjson.serializer.SerializeFilter... filters)
已过时。
|
protected boolean |
supports(Class<?> clazz) |
void |
write(Object o,
Type type,
org.springframework.http.MediaType contentType,
org.springframework.http.HttpOutputMessage outputMessage) |
protected void |
writeInternal(Object object,
org.springframework.http.HttpOutputMessage outputMessage) |
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writepublic static final org.springframework.http.MediaType APPLICATION_JAVASCRIPT
@Deprecated protected com.alibaba.fastjson.serializer.SerializerFeature[] features
@Deprecated protected com.alibaba.fastjson.serializer.SerializeFilter[] filters
@Deprecated protected String dateFormat
public CustomFastJsonHttpMessageConverter()
public com.alibaba.fastjson.support.config.FastJsonConfig getFastJsonConfig()
public void setFastJsonConfig(com.alibaba.fastjson.support.config.FastJsonConfig fastJsonConfig)
fastJsonConfig - the fastJsonConfig to set.@Deprecated public Charset getCharset()
@Deprecated public void setCharset(Charset charset)
@Deprecated public String getDateFormat()
@Deprecated public void setDateFormat(String dateFormat)
@Deprecated public com.alibaba.fastjson.serializer.SerializerFeature[] getFeatures()
@Deprecated public void setFeatures(com.alibaba.fastjson.serializer.SerializerFeature... features)
@Deprecated public com.alibaba.fastjson.serializer.SerializeFilter[] getFilters()
@Deprecated public void setFilters(com.alibaba.fastjson.serializer.SerializeFilter... filters)
@Deprecated public void addSerializeFilter(com.alibaba.fastjson.serializer.SerializeFilter filter)
protected boolean supports(Class<?> clazz)
supports 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>public boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
canRead 在接口中 org.springframework.http.converter.GenericHttpMessageConverter<Object>public boolean canWrite(Type type, Class<?> clazz, org.springframework.http.MediaType mediaType)
canWrite 在接口中 org.springframework.http.converter.GenericHttpMessageConverter<Object>public Object read(Type type, Class<?> contextClass, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
read 在接口中 org.springframework.http.converter.GenericHttpMessageConverter<Object>IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionpublic void write(Object o, Type type, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
write 在接口中 org.springframework.http.converter.GenericHttpMessageConverter<Object>IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionprotected Object readInternal(Class<? extends Object> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
readInternal 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionprotected void writeInternal(Object object, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
writeInternal 在类中 org.springframework.http.converter.AbstractHttpMessageConverter<Object>IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionCopyright © 2020. All rights reserved.