类 AbstractEncoder<T>

java.lang.Object
cn.taketoday.core.codec.AbstractEncoder<T>
类型参数:
T - the element type
所有已实现的接口:
Encoder<T>
直接已知子类:
AbstractSingleValueEncoder, ByteArrayEncoder, ByteBufferEncoder, CharSequenceEncoder, DataBufferEncoder, Netty5BufferEncoder, NettyByteBufEncoder, ResourceRegionEncoder

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

    • encodableMimeTypes

      private final List<MimeType> encodableMimeTypes
    • logger

      protected Logger logger
  • 构造器详细资料

    • AbstractEncoder

      protected AbstractEncoder(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.
    • getEncodableMimeTypes

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

      public boolean canEncode(ResolvableType elementType, @Nullable MimeType mimeType)
      从接口复制的说明: Encoder
      Whether the encoder supports the given source element type and the MIME type for the output stream.
      指定者:
      canEncode 在接口中 Encoder<T>
      参数:
      elementType - the type of elements in the source stream
      mimeType - the MIME type for the output stream (can be null if not specified)
      返回:
      true if supported, false otherwise