Class Fastjson2Encoder
java.lang.Object
org.springframework.core.codec.AbstractEncoder<Object>
com.alibaba.fastjson2.support.spring6.codec.Fastjson2Encoder
- All Implemented Interfaces:
org.springframework.core.codec.Encoder<Object>
spring message codec encoder for Fastjson2.
- Since:
- 2025/8/6
- Author:
- 张治保
-
Field Summary
Fields inherited from class org.springframework.core.codec.AbstractEncoder
logger -
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorFastjson2Encoder(FastJsonConfig config, org.springframework.util.MimeType... mimeTypes) Constructor with custom configs -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encode(org.reactivestreams.Publisher<?> inputStream, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) org.springframework.core.io.buffer.DataBufferencodeValue(Object value, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType valueType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) Methods inherited from class org.springframework.core.codec.AbstractEncoder
canEncode, getEncodableMimeTypes, getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.codec.Encoder
getEncodableMimeTypes
-
Constructor Details
-
Fastjson2Encoder
public Fastjson2Encoder()default constructor -
Fastjson2Encoder
Constructor with custom configs- Parameters:
config- FastJsonConfigmimeTypes- the mime types to support
-
-
Method Details
-
encode
@NonNull public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encode(@NonNull org.reactivestreams.Publisher<?> inputStream, @NonNull org.springframework.core.io.buffer.DataBufferFactory bufferFactory, @NonNull org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) -
encodeValue
@NonNull public org.springframework.core.io.buffer.DataBuffer encodeValue(@Nullable Object value, @NonNull org.springframework.core.io.buffer.DataBufferFactory bufferFactory, @NonNull org.springframework.core.ResolvableType valueType, org.springframework.util.MimeType mimeType, Map<String, Object> hints)
-