类 AbstractDecoder<T>

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

public abstract class AbstractDecoder<T> extends Object implements Decoder<T>
Abstract base class for Decoder implementations.
从以下版本开始:
4.0
作者:
Sebastien Deleuze, Arjen Poutsma
  • 字段详细资料

    • logger

      protected Logger logger
  • 构造器详细资料

    • AbstractDecoder

      protected AbstractDecoder(MimeType... supportedMimeTypes)
  • 方法详细资料

    • setLogger

      public void setLogger(Logger logger)
      Set an alternative logger to use than the one based on the class name.
      参数:
      logger - the logger to use
    • getLogger

      public Logger getLogger()
      Return the currently configured Logger.
    • getDecodableMimeTypes

      public List<MimeType> getDecodableMimeTypes()
      从接口复制的说明: Decoder
      Return the list of MIME types supported by this Decoder. The list may not apply to every possible target element type and calls to this method should typically be guarded via canDecode(elementType, null). The list may also exclude MIME types supported only for a specific element type. Alternatively, use Decoder.getDecodableMimeTypes(ResolvableType) for a more precise list.
      指定者:
      getDecodableMimeTypes 在接口中 Decoder<T>
      返回:
      the list of supported MIME types
    • canDecode

      public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
      从接口复制的说明: Decoder
      Whether the decoder supports the given target element type and the MIME type of the source stream.
      指定者:
      canDecode 在接口中 Decoder<T>
      参数:
      elementType - the target element type for the output stream
      mimeType - the mime type associated with the stream to decode (can be null if not specified)
      返回:
      true if supported, false otherwise
    • decodeToMono

      public reactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
      从接口复制的说明: Decoder
      Decode a DataBuffer input stream into a Mono of T.
      指定者:
      decodeToMono 在接口中 Decoder<T>
      参数:
      inputStream - the DataBuffer input stream to decode
      elementType - the expected type of elements in the output stream; this type must have been previously passed to the Decoder.canDecode(cn.taketoday.core.ResolvableType, cn.taketoday.util.MimeType) method and it must have returned true.
      mimeType - the MIME type associated with the input stream (optional)
      hints - additional information about how to do decode
      返回:
      the output stream with the decoded element