Class Fastjson2Decoder

java.lang.Object
org.springframework.core.codec.AbstractDecoder<Object>
com.alibaba.fastjson2.support.spring6.codec.Fastjson2Decoder
All Implemented Interfaces:
org.springframework.core.codec.Decoder<Object>

public final class Fastjson2Decoder extends org.springframework.core.codec.AbstractDecoder<Object>
spring message codec decoder for Fastjson2.
Since:
2025/8/6
Author:
张治保
  • Field Summary

    Fields inherited from class org.springframework.core.codec.AbstractDecoder

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    default constructor
    Fastjson2Decoder(FastJsonConfig config, org.springframework.util.MimeType... mimeTypes)
    Constructor with custom configs
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Flux<Object>
    decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String,Object> hints)
     
    decode(org.springframework.core.io.buffer.DataBuffer buffer, org.springframework.core.ResolvableType targetType, org.springframework.util.MimeType mimeType, Map<String,Object> hints)
     
    reactor.core.publisher.Mono<Object>
    decodeToMono(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String,Object> hints)
     

    Methods inherited from class org.springframework.core.codec.AbstractDecoder

    canDecode, getDecodableMimeTypes, getLogger, setLogger

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.core.codec.Decoder

    getDecodableMimeTypes
  • Constructor Details

    • Fastjson2Decoder

      public Fastjson2Decoder()
      default constructor
    • Fastjson2Decoder

      public Fastjson2Decoder(FastJsonConfig config, org.springframework.util.MimeType... mimeTypes)
      Constructor with custom configs
      Parameters:
      config - FastJsonConfig
      mimeTypes - the mime types to support
  • Method Details

    • decode

      @NonNull public reactor.core.publisher.Flux<Object> decode(@NonNull org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, @NonNull org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
    • decode

      @Nullable public Object decode(@NonNull org.springframework.core.io.buffer.DataBuffer buffer, @NonNull org.springframework.core.ResolvableType targetType, org.springframework.util.MimeType mimeType, Map<String,Object> hints) throws org.springframework.core.codec.DecodingException
      Throws:
      org.springframework.core.codec.DecodingException
    • decodeToMono

      @NonNull public reactor.core.publisher.Mono<Object> decodeToMono(@NonNull org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, @NonNull org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Specified by:
      decodeToMono in interface org.springframework.core.codec.Decoder<Object>
      Overrides:
      decodeToMono in class org.springframework.core.codec.AbstractDecoder<Object>