类 AbstractSingleValueEncoder<T>

java.lang.Object
cn.taketoday.core.codec.AbstractEncoder<T>
cn.taketoday.core.codec.AbstractSingleValueEncoder<T>
类型参数:
T - the element type
所有已实现的接口:
Encoder<T>
直接已知子类:
ResourceEncoder

public abstract class AbstractSingleValueEncoder<T> extends AbstractEncoder<T>
Abstract base class for Encoder classes that can only deal with a single value.
从以下版本开始:
4.0
作者:
Arjen Poutsma
  • 构造器详细资料

    • AbstractSingleValueEncoder

      public AbstractSingleValueEncoder(MimeType... supportedMimeTypes)
  • 方法详细资料

    • encode

      public final reactor.core.publisher.Flux<DataBuffer> encode(org.reactivestreams.Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
      从接口复制的说明: Encoder
      Encode a stream of Objects of type T into a DataBuffer output stream.
      参数:
      inputStream - the input stream of Objects to encode. If the input should be encoded as a single value rather than as a stream of elements, an instance of Mono should be used.
      bufferFactory - for creating output stream DataBuffer's
      elementType - the expected type of elements in the input stream; this type must have been previously passed to the Encoder.canEncode(cn.taketoday.core.ResolvableType, cn.taketoday.util.MimeType) method and it must have returned true.
      mimeType - the MIME type for the output content (optional)
      hints - additional information about how to encode
      返回:
      the output stream
    • encode

      protected abstract reactor.core.publisher.Flux<DataBuffer> encode(T t, DataBufferFactory dataBufferFactory, ResolvableType type, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
      Encode T to an output DataBuffer stream.
      参数:
      t - the value to process
      dataBufferFactory - a buffer factory used to create the output
      type - the stream element type to process
      mimeType - the mime type to process
      hints - additional information about how to do decode, optional
      返回:
      the output stream