Class FastJsonHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter
- All Implemented Interfaces:
org.springframework.http.converter.GenericHttpMessageConverter<Object>,org.springframework.http.converter.HttpMessageConverter<Object>
public class FastJsonHttpMessageConverter
extends org.springframework.http.converter.AbstractHttpMessageConverter<Object>
implements org.springframework.http.converter.GenericHttpMessageConverter<Object>
Fastjson for Spring MVC Converter.
- Since:
- 2.0.2
- Author:
- Victor.Zxy
- See Also:
-
AbstractHttpMessageConverterGenericHttpMessageConverter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.http.MediaTypeFields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanprotected Typeprotected ObjectreadInternal(Class<?> clazz, org.springframework.http.HttpInputMessage inputMessage) voidsetFastJsonConfig(FastJsonConfig fastJsonConfig) protected booleanvoidwrite(Object o, Type type, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) protected voidwriteInternal(Object object, org.springframework.http.HttpOutputMessage outputMessage) Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.converter.HttpMessageConverter
canRead, canWrite, getSupportedMediaTypes, getSupportedMediaTypes, read, write
-
Field Details
-
APPLICATION_JAVASCRIPT
public static final org.springframework.http.MediaType APPLICATION_JAVASCRIPT
-
-
Constructor Details
-
FastJsonHttpMessageConverter
public FastJsonHttpMessageConverter()Can serialize/deserialize all types.
-
-
Method Details
-
getFastJsonConfig
- Returns:
- the fastJsonConfig.
-
setFastJsonConfig
- Parameters:
fastJsonConfig- the fastJsonConfig to set.
-
supports
- Specified by:
supportsin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>
-
canRead
public boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType) - Specified by:
canReadin interfaceorg.springframework.http.converter.GenericHttpMessageConverter<Object>
-
canWrite
- Specified by:
canWritein interfaceorg.springframework.http.converter.GenericHttpMessageConverter<Object>
-
read
public Object read(Type type, Class<?> contextClass, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException - Specified by:
readin interfaceorg.springframework.http.converter.GenericHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotReadableException
-
write
public void write(Object o, Type type, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException - Specified by:
writein interfaceorg.springframework.http.converter.GenericHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotWritableException
-
readInternal
protected Object readInternal(Class<?> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException - Specified by:
readInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotReadableException
-
writeInternal
protected void writeInternal(Object object, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException - Specified by:
writeInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotWritableException
-
getType
-