public class FastJsonHttpMessageConverter 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
Modifier and Type | Field and Description |
---|---|
static org.springframework.http.MediaType |
APPLICATION_JAVASCRIPT |
Constructor and Description |
---|
FastJsonHttpMessageConverter()
Can serialize/deserialize all types.
|
Modifier and Type | Method and Description |
---|---|
void |
addSerializeFilter(SerializeFilter filter)
Deprecated.
|
boolean |
canRead(Type type,
Class<?> contextClass,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Type type,
Class<?> clazz,
org.springframework.http.MediaType mediaType) |
Charset |
getCharset()
Deprecated.
|
String |
getDateFormat()
Deprecated.
|
FastJsonConfig |
getFastJsonConfig() |
SerializerFeature[] |
getFeatures()
Deprecated.
|
SerializeFilter[] |
getFilters()
Deprecated.
|
Object |
read(Type type,
Class<?> contextClass,
org.springframework.http.HttpInputMessage inputMessage) |
void |
setCharset(Charset charset)
Deprecated.
|
void |
setDateFormat(String dateFormat)
Deprecated.
|
void |
setFastJsonConfig(FastJsonConfig fastJsonConfig) |
void |
setFeatures(SerializerFeature... features)
Deprecated.
|
void |
setFilters(SerializeFilter... filters)
Deprecated.
|
void |
write(Object o,
Type type,
org.springframework.http.MediaType contentType,
org.springframework.http.HttpOutputMessage outputMessage) |
canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
public static final org.springframework.http.MediaType APPLICATION_JAVASCRIPT
public FastJsonHttpMessageConverter()
public FastJsonConfig getFastJsonConfig()
public void setFastJsonConfig(FastJsonConfig fastJsonConfig)
fastJsonConfig
- the fastJsonConfig to set.@Deprecated public Charset getCharset()
FastJsonConfig.getCharset()
@Deprecated public void setCharset(Charset charset)
charset
- the charsetFastJsonConfig.setCharset(Charset)
@Deprecated public String getDateFormat()
FastJsonConfig.getDateFormat()
@Deprecated public void setDateFormat(String dateFormat)
dateFormat
- the date formatFastJsonConfig.setDateFormat(String)
@Deprecated public SerializerFeature[] getFeatures()
FastJsonConfig.getSerializerFeatures()
@Deprecated public void setFeatures(SerializerFeature... features)
features
- the featuresFastJsonConfig.setSerializerFeatures(SerializerFeature...)
@Deprecated public SerializeFilter[] getFilters()
FastJsonConfig.getSerializeFilters()
@Deprecated public void setFilters(SerializeFilter... filters)
filters
- the filtersFastJsonConfig.setSerializeFilters(SerializeFilter...)
@Deprecated public void addSerializeFilter(SerializeFilter filter)
filter
- the filterFastJsonConfig.setSerializeFilters(SerializeFilter...)
public boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
canRead
in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
public boolean canWrite(Type type, Class<?> clazz, org.springframework.http.MediaType mediaType)
canWrite
in interface 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
in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
IOException
org.springframework.http.converter.HttpMessageNotReadableException
public void write(Object o, Type type, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
write
in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
IOException
org.springframework.http.converter.HttpMessageNotWritableException
Copyright © 2012–2022 Alibaba Group. All rights reserved.