org.springframework.core.codec

Interface Decoder<T>

    • Method Detail

      • canDecode

        boolean canDecode(ResolvableType elementType,
                          @Nullable
                          MimeType mimeType)
        Whether the decoder supports the given target element type and the MIME type of the source stream.
        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
      • decode

        reactor.core.publisher.Flux<T> decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
                                              ResolvableType elementType,
                                              @Nullable
                                              MimeType mimeType,
                                              @Nullable
                                              java.util.Map<java.lang.String,java.lang.Object> hints)
        Decode a DataBuffer input stream into a Flux of T.
        Parameters:
        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 canDecode(org.springframework.core.ResolvableType, org.springframework.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 encode
        Returns:
        the output stream with decoded elements
      • decodeToMono

        reactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream,
                                                    ResolvableType elementType,
                                                    @Nullable
                                                    MimeType mimeType,
                                                    @Nullable
                                                    java.util.Map<java.lang.String,java.lang.Object> hints)
        Decode a DataBuffer input stream into a Mono of T.
        Parameters:
        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 canDecode(org.springframework.core.ResolvableType, org.springframework.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 encode
        Returns:
        the output stream with the decoded element
      • getDecodableMimeTypes

        java.util.List<MimeType> getDecodableMimeTypes()
        Return the list of MIME types this decoder supports.