org.springframework.http.codec

Interface HttpMessageReader<T>

    • Method Detail

      • getReadableMediaTypes

        java.util.List<MediaType> getReadableMediaTypes()
        Return the MediaType's that this reader supports.
      • canRead

        boolean canRead(ResolvableType elementType,
                        @Nullable
                        MediaType mediaType)
        Whether the given object type is supported by this reader.
        Parameters:
        elementType - the type of object to check
        mediaType - the media type for the read (possibly null)
        Returns:
        true if readable, false otherwise
      • read

        reactor.core.publisher.Flux<T> read(ResolvableType elementType,
                                            ReactiveHttpInputMessage message,
                                            java.util.Map<java.lang.String,java.lang.Object> hints)
        Read from the input message and encode to a stream of objects.
        Parameters:
        elementType - the type of objects in the stream which must have been previously checked via canRead(ResolvableType, MediaType)
        message - the message to read from
        hints - additional information about how to read and decode the input
        Returns:
        the decoded stream of elements
      • readMono

        reactor.core.publisher.Mono<T> readMono(ResolvableType elementType,
                                                ReactiveHttpInputMessage message,
                                                java.util.Map<java.lang.String,java.lang.Object> hints)
        Read from the input message and encode to a single object.
        Parameters:
        elementType - the type of objects in the stream which must have been previously checked via canRead(ResolvableType, MediaType)
        message - the message to read from
        hints - additional information about how to read and decode the input
        Returns:
        the decoded object