类 ForestFastjson2Converter

java.lang.Object
com.dtflys.forest.converter.json.ForestFastjson2Converter
所有已实现的接口:
ForestConverter<String>, ForestEncoder, ForestJsonConverter

public class ForestFastjson2Converter extends Object implements ForestJsonConverter
使用Fastjson实现的消息转换实现类
从以下版本开始:
2016-05-30
作者:
gongjun
  • 构造器详细资料

    • ForestFastjson2Converter

      public ForestFastjson2Converter()
  • 方法详细资料

    • getWriterFeatures

      public List<com.alibaba.fastjson2.JSONWriter.Feature> getWriterFeatures()
    • getReadFeatures

      public List<com.alibaba.fastjson2.JSONReader.Feature> getReadFeatures()
    • addWriterFeature

      public void addWriterFeature(com.alibaba.fastjson2.JSONWriter.Feature feature)
    • addReadFeature

      public void addReadFeature(com.alibaba.fastjson2.JSONReader.Feature feature)
    • convertToJavaObject

      public <T> T convertToJavaObject(String source, Type targetType)
      从接口复制的说明: ForestConverter
      将源数据转换为目标类型(Type)的java对象
      指定者:
      convertToJavaObject 在接口中 ForestConverter<String>
      类型参数:
      T - 目标类型泛型
      参数:
      source - 源数据
      targetType - 目标类型 (Type对象)
      返回:
      转换后的目标类型对象
    • convertToJavaObject

      public <T> T convertToJavaObject(byte[] source, Class<T> targetType, Charset charset)
      从接口复制的说明: ForestConverter
      将源数据转换为目标类型(Class)的java对象
      指定者:
      convertToJavaObject 在接口中 ForestConverter<String>
      类型参数:
      T - 目标类型泛型
      参数:
      source - 源数据
      targetType - 目标类型 (Class对象)
      charset - 字符集
      返回:
      转换后的目标类型对象
    • convertToJavaObject

      public <T> T convertToJavaObject(byte[] source, Type targetType, Charset charset)
      从接口复制的说明: 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

      public String encodeToString(Object obj)
      指定者:
      encodeToString 在接口中 ForestEncoder
    • convertObjectToMap

      public Map<String,Object> convertObjectToMap(Object obj, ForestRequest request, ConvertOptions options)
      从接口复制的说明: ForestJsonConverter
      将源对象转换为Map对象
      指定者:
      convertObjectToMap 在接口中 ForestJsonConverter
      参数:
      obj - 源对象
      request - 请求对象
      options - 转换选项
      返回:
      转换后的Map对象
    • setDateFormat

      public void setDateFormat(String format)
      从接口复制的说明: ForestJsonConverter
      设置日期格式
      指定者:
      setDateFormat 在接口中 ForestJsonConverter
      参数:
      format - 日期格式化模板字符
    • getDateFormat

      public String getDateFormat()
      从接口复制的说明: ForestJsonConverter
      获取日期格式
      指定者:
      getDateFormat 在接口中 ForestJsonConverter
      返回:
      日期格式化模板字符
    • getDataType

      public ForestDataType getDataType()
      从接口复制的说明: ForestConverter
      获取当前数据转换器转换类型
      指定者:
      getDataType 在接口中 ForestConverter<String>
      返回:
      ForestDataType 对象实例