public class FastJsonHttpMessageConverter
extends org.springframework.http.converter.AbstractHttpMessageConverter<java.lang.Object>
implements org.springframework.http.converter.GenericHttpMessageConverter<java.lang.Object>
Compatible fastjson 1.2.x
AbstractHttpMessageConverter,
GenericHttpMessageConverter| Modifier and Type | Class and Description |
|---|---|
private static class |
FastJsonHttpMessageConverter.Spring4TypeResolvableHelper |
| Modifier and Type | Field and Description |
|---|---|
static org.springframework.http.MediaType |
APPLICATION_JAVASCRIPT |
private FastJsonConfig |
fastJsonConfig
with fastJson config
|
| Constructor and Description |
|---|
FastJsonHttpMessageConverter()
Can serialize/deserialize all types.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
org.springframework.http.MediaType mediaType) |
FastJsonConfig |
getFastJsonConfig() |
protected java.lang.reflect.Type |
getType(java.lang.reflect.Type type,
java.lang.Class<?> contextClass) |
java.lang.Object |
read(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
org.springframework.http.HttpInputMessage inputMessage) |
protected java.lang.Object |
readInternal(java.lang.Class<?> clazz,
org.springframework.http.HttpInputMessage inputMessage) |
private java.lang.Object |
readType(java.lang.reflect.Type type,
org.springframework.http.HttpInputMessage inputMessage) |
void |
setFastJsonConfig(FastJsonConfig fastJsonConfig) |
protected boolean |
supports(java.lang.Class<?> clazz) |
void |
write(java.lang.Object o,
java.lang.reflect.Type type,
org.springframework.http.MediaType contentType,
org.springframework.http.HttpOutputMessage outputMessage) |
protected void |
writeInternal(java.lang.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
private FastJsonConfig fastJsonConfig
public FastJsonHttpMessageConverter()
public FastJsonConfig getFastJsonConfig()
public void setFastJsonConfig(FastJsonConfig fastJsonConfig)
fastJsonConfig - the fastJsonConfig to set.protected boolean supports(java.lang.Class<?> clazz)
supports in class org.springframework.http.converter.AbstractHttpMessageConverter<java.lang.Object>public boolean canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
org.springframework.http.MediaType mediaType)
canRead in interface org.springframework.http.converter.GenericHttpMessageConverter<java.lang.Object>public boolean canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
org.springframework.http.MediaType mediaType)
canWrite in interface org.springframework.http.converter.GenericHttpMessageConverter<java.lang.Object>public java.lang.Object read(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
org.springframework.http.HttpInputMessage inputMessage)
throws java.io.IOException,
org.springframework.http.converter.HttpMessageNotReadableException
read in interface org.springframework.http.converter.GenericHttpMessageConverter<java.lang.Object>java.io.IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionpublic void write(java.lang.Object o,
java.lang.reflect.Type type,
org.springframework.http.MediaType contentType,
org.springframework.http.HttpOutputMessage outputMessage)
throws java.io.IOException,
org.springframework.http.converter.HttpMessageNotWritableException
write in interface org.springframework.http.converter.GenericHttpMessageConverter<java.lang.Object>java.io.IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionprotected java.lang.Object readInternal(java.lang.Class<?> clazz,
org.springframework.http.HttpInputMessage inputMessage)
throws java.io.IOException,
org.springframework.http.converter.HttpMessageNotReadableException
readInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<java.lang.Object>java.io.IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionprivate java.lang.Object readType(java.lang.reflect.Type type,
org.springframework.http.HttpInputMessage inputMessage)
protected void writeInternal(java.lang.Object object,
org.springframework.http.HttpOutputMessage outputMessage)
throws java.io.IOException,
org.springframework.http.converter.HttpMessageNotWritableException
writeInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<java.lang.Object>java.io.IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionprotected java.lang.reflect.Type getType(java.lang.reflect.Type type,
java.lang.Class<?> contextClass)