org.springframework.core.codec

Class AbstractDecoder<T>

  • java.lang.Object
    • org.springframework.core.codec.AbstractDecoder<T>
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected Log logger 
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected AbstractDecoder(MimeType... supportedMimeTypes) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean canDecode(ResolvableType elementType, MimeType mimeType)
      Whether the decoder supports the given target element type and the MIME type of the source stream.
      reactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, java.util.Map<java.lang.String,java.lang.Object> hints)
      Decode a DataBuffer input stream into a Mono of T.
      java.util.List<MimeType> getDecodableMimeTypes()
      Return the list of MIME types this decoder supports.
      Log getLogger()
      Return the currently configured Logger.
      void setLogger(Log logger)
      Set an alternative logger to use than the one based on the class name.
      • 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

        decode
    • Field Detail

      • logger

        protected Log logger
    • Constructor Detail

      • AbstractDecoder

        protected AbstractDecoder(MimeType... supportedMimeTypes)
    • Method Detail

      • setLogger

        public void setLogger(Log logger)
        Set an alternative logger to use than the one based on the class name.
        Parameters:
        logger - the logger to use
        Since:
        5.1
      • getLogger

        public Log getLogger()
        Return the currently configured Logger.
        Since:
        5.1
      • getDecodableMimeTypes

        public java.util.List<MimeType> getDecodableMimeTypes()
        Description copied from interface: Decoder
        Return the list of MIME types this decoder supports.
        Specified by:
        getDecodableMimeTypes in interface Decoder<T>
      • canDecode

        public boolean canDecode(ResolvableType elementType,
                                 @Nullable
                                 MimeType mimeType)
        Description copied from interface: Decoder
        Whether the decoder supports the given target element type and the MIME type of the source stream.
        Specified by:
        canDecode in interface Decoder<T>
        Parameters:
        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)
        Returns:
        true if supported, false otherwise