Class JsonMessageConverter
- java.lang.Object
-
- com.foxinmy.weixin4j.http.message.AbstractMessageConverter
-
- com.foxinmy.weixin4j.http.message.JsonMessageConverter
-
- All Implemented Interfaces:
MessageConverter
public class JsonMessageConverter extends AbstractMessageConverter
JSON 转换- Since:
- JDK 1.6
- Author:
- jinyu
-
-
Field Summary
Fields Modifier and Type Field Description static JsonMessageConverter
GLOBAL
-
Fields inherited from class com.foxinmy.weixin4j.http.message.AbstractMessageConverter
charset
-
-
Constructor Summary
Constructors Constructor Description JsonMessageConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(Class<?> clazz, HttpResponse response)
是否可以转换protected <T> T
convertInternal(Class<? extends T> clazz, InputStream body)
protected boolean
supports(Class<?> clazz, byte[] content)
满足其中一个supports-
Methods inherited from class com.foxinmy.weixin4j.http.message.AbstractMessageConverter
convert, getCharset, setCharset, setSupportedMediaTypes, supportedMimeTypes, supports
-
-
-
-
Field Detail
-
GLOBAL
public static final JsonMessageConverter GLOBAL
-
-
Method Detail
-
canConvert
public boolean canConvert(Class<?> clazz, HttpResponse response)
Description copied from interface:MessageConverter
是否可以转换- Specified by:
canConvert
in interfaceMessageConverter
- Overrides:
canConvert
in classAbstractMessageConverter
- Parameters:
clazz
- 转换类型response
- 响应对象- Returns:
- 是否标识
-
supports
protected boolean supports(Class<?> clazz, byte[] content)
Description copied from class:AbstractMessageConverter
满足其中一个supports- Specified by:
supports
in classAbstractMessageConverter
- Parameters:
clazz
- 转换类型content
- 内容数据- Returns:
- 支持标识
-
convertInternal
protected <T> T convertInternal(Class<? extends T> clazz, InputStream body) throws IOException
- Specified by:
convertInternal
in classAbstractMessageConverter
- Throws:
IOException
-
-