Module bus.starter

Class FastJsonConverterConfigurer

java.lang.Object
org.miaixz.bus.spring.web.FastJsonConverterConfigurer
All Implemented Interfaces:
JsonConverterConfigurer

@Component @ConditionalOnClass(com.alibaba.fastjson2.JSON.class) public class FastJsonConverterConfigurer extends Object implements JsonConverterConfigurer
Fastjson2 JSON 转换器配置器。 配置 Fastjson2 的 HttpMessageConverter,支持 autoType 自动类型识别。
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • FastJsonConverterConfigurer

      public FastJsonConverterConfigurer()
  • Method Details

    • name

      public String name()
      Description copied from interface: JsonConverterConfigurer
      返回转换器的名称,用于日志和调试。
      Specified by:
      name in interface JsonConverterConfigurer
      Returns:
      转换器名称
    • order

      public int order()
      Description copied from interface: JsonConverterConfigurer
      返回转换器的优先级顺序(值越小,优先级越高)。
      Specified by:
      order in interface JsonConverterConfigurer
      Returns:
      优先级顺序
    • configure

      public void configure(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
      Description copied from interface: JsonConverterConfigurer
      配置 HttpMessageConverter 列表。
      Specified by:
      configure in interface JsonConverterConfigurer
      Parameters:
      converters - 要配置的消息转换器列表
    • autoType

      public void autoType(String autoType)
      Description copied from interface: JsonConverterConfigurer
      设置 autoType 属性,用于序列化/反序列化配置。 默认实现为空,子类可覆盖以支持 autoType。
      Specified by:
      autoType in interface JsonConverterConfigurer
      Parameters:
      autoType - 自动类型配置字符串