类 ForestFastjson2Converter
java.lang.Object
com.dtflys.forest.converter.json.ForestFastjson2Converter
- 所有已实现的接口:
ForestConverter<String>,ForestEncoder,ForestJsonConverter
使用Fastjson实现的消息转换实现类
- 从以下版本开始:
- 2016-05-30
- 作者:
- gongjun
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddReadFeature(com.alibaba.fastjson2.JSONReader.Feature feature) voidaddWriterFeature(com.alibaba.fastjson2.JSONWriter.Feature feature) convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) 将源对象转换为Map对象<T> TconvertToJavaObject(byte[] source, Class<T> targetType, Charset charset) 将源数据转换为目标类型(Class)的java对象<T> TconvertToJavaObject(byte[] source, Type targetType, Charset charset) 将源数据转换为目标类型(Type)的java对象<T> TconvertToJavaObject(String source, com.alibaba.fastjson2.TypeReference<T> typeReference) <T> TconvertToJavaObject(String source, Type targetType) 将源数据转换为目标类型(Type)的java对象encodeToString(Object obj) 获取当前数据转换器转换类型获取日期格式List<com.alibaba.fastjson2.JSONReader.Feature>List<com.alibaba.fastjson2.JSONWriter.Feature>voidsetDateFormat(String format) 设置日期格式从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 com.dtflys.forest.converter.ForestConverter
convertToJavaObject从接口继承的方法 com.dtflys.forest.converter.ForestEncoder
encodeRequestBody, encodeRequestBody, encodeRequestBody从接口继承的方法 com.dtflys.forest.converter.json.ForestJsonConverter
convertObjectToMap, convertObjectToMap, encodeRequestBody
-
构造器详细资料
-
ForestFastjson2Converter
public ForestFastjson2Converter()
-
-
方法详细资料
-
getWriterFeatures
-
getReadFeatures
-
addWriterFeature
public void addWriterFeature(com.alibaba.fastjson2.JSONWriter.Feature feature) -
addReadFeature
public void addReadFeature(com.alibaba.fastjson2.JSONReader.Feature feature) -
convertToJavaObject
从接口复制的说明:ForestConverter将源数据转换为目标类型(Type)的java对象- 指定者:
convertToJavaObject在接口中ForestConverter<String>- 类型参数:
T- 目标类型泛型- 参数:
source- 源数据targetType- 目标类型 (Type对象)- 返回:
- 转换后的目标类型对象
-
convertToJavaObject
从接口复制的说明:ForestConverter将源数据转换为目标类型(Class)的java对象- 指定者:
convertToJavaObject在接口中ForestConverter<String>- 类型参数:
T- 目标类型泛型- 参数:
source- 源数据targetType- 目标类型 (Class对象)charset- 字符集- 返回:
- 转换后的目标类型对象
-
convertToJavaObject
从接口复制的说明:ForestConverter将源数据转换为目标类型(Type)的java对象- 指定者:
convertToJavaObject在接口中ForestConverter<String>- 类型参数:
T- 目标类型泛型- 参数:
source- 源数据targetType- 目标类型 (Type对象)charset- 字符集- 返回:
- 转换后的目标类型对象
-
convertToJavaObject
public <T> T convertToJavaObject(String source, com.alibaba.fastjson2.TypeReference<T> typeReference) -
encodeToString
- 指定者:
encodeToString在接口中ForestEncoder
-
convertObjectToMap
public Map<String,Object> convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options) 从接口复制的说明:ForestJsonConverter将源对象转换为Map对象- 指定者:
convertObjectToMap在接口中ForestJsonConverter- 参数:
obj- 源对象request- 请求对象options- 转换选项- 返回:
- 转换后的Map对象
-
setDateFormat
从接口复制的说明:ForestJsonConverter设置日期格式- 指定者:
setDateFormat在接口中ForestJsonConverter- 参数:
format- 日期格式化模板字符
-
getDateFormat
从接口复制的说明:ForestJsonConverter获取日期格式- 指定者:
getDateFormat在接口中ForestJsonConverter- 返回:
- 日期格式化模板字符
-
getDataType
从接口复制的说明:ForestConverter获取当前数据转换器转换类型- 指定者:
getDataType在接口中ForestConverter<String>- 返回:
ForestDataType对象实例
-