public class ForestFastjsonConverter extends Object implements ForestJsonConverter
Constructor and Description |
---|
ForestFastjsonConverter() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
convertObjectToMap(Object obj)
将源对象转换为Map对象
|
<T> T |
convertToJavaObject(String source,
Class<T> targetType)
将源数据转换为目标类型(Class)的java对象
|
<T> T |
convertToJavaObject(String source,
Type targetType)
将源数据转换为目标类型(Type)的java对象
|
<T> T |
convertToJavaObject(String source,
com.alibaba.fastjson.TypeReference<T> typeReference) |
Map<String,Object> |
defaultJsonMap(Object obj) |
String |
encodeToString(Object obj) |
String |
getDateFormat()
获取日期格式
|
com.alibaba.fastjson.serializer.SerializerFeature |
getSerializerFeature()
获取FastJson的序列化特性对象
|
String |
getSerializerFeatureName()
获取FastJson的序列化特性名
|
ForestConverter |
setDateFormat(String format)
设置日期格式
|
void |
setSerializerFeature(com.alibaba.fastjson.serializer.SerializerFeature serializerFeature)
设置FastJson的序列化特性对象
|
void |
setSerializerFeatureName(String serializerFeatureName)
设置FastJson的序列化特性名
|
public String getSerializerFeatureName()
public void setSerializerFeatureName(String serializerFeatureName)
serializerFeatureName
- FastJson的序列化特性名字符串public com.alibaba.fastjson.serializer.SerializerFeature getSerializerFeature()
SerializerFeature
枚举实例public void setSerializerFeature(com.alibaba.fastjson.serializer.SerializerFeature serializerFeature)
serializerFeature
- FastJson的序列化特性对象,SerializerFeature
枚举实例public <T> T convertToJavaObject(String source, Class<T> targetType)
ForestConverter
convertToJavaObject
in interface ForestConverter<String>
T
- 目标类型泛型source
- 源数据targetType
- 目标类型 (Class对象)public <T> T convertToJavaObject(String source, Type targetType)
ForestConverter
convertToJavaObject
in interface ForestConverter<String>
T
- 目标类型泛型source
- 源数据targetType
- 目标类型 (Type对象)public <T> T convertToJavaObject(String source, com.alibaba.fastjson.TypeReference<T> typeReference)
public String encodeToString(Object obj)
encodeToString
in interface ForestEncoder
public Map<String,Object> convertObjectToMap(Object obj)
ForestJsonConverter
convertObjectToMap
in interface ForestJsonConverter
obj
- 源对象public ForestConverter setDateFormat(String format)
ForestJsonConverter
setDateFormat
in interface ForestJsonConverter
format
- 日期格式化模板字符ForestConverter
接口实例public String getDateFormat()
ForestJsonConverter
getDateFormat
in interface ForestJsonConverter
Copyright © 2020. All rights reserved.