public abstract class BodyExtractors
extends java.lang.Object
BodyExtractor
that read various bodies, such a reactive streams.Modifier and Type | Field and Description |
---|---|
private static ResolvableType |
FORM_TYPE |
Constructor and Description |
---|
BodyExtractors() |
Modifier and Type | Method and Description |
---|---|
private static <T> HttpMessageReader<T> |
cast(HttpMessageReader<?> messageReader) |
private static MediaType |
contentType(HttpMessage message) |
private static HttpMessageReader<MultiValueMap<java.lang.String,java.lang.String>> |
formMessageReader(BodyExtractor.Context context) |
private static <T,S extends <any>> |
readWithMessageReaders(ReactiveHttpInputMessage inputMessage,
BodyExtractor.Context context,
ResolvableType elementType,
java.util.function.Function<HttpMessageReader<T>,S> readerFunction,
java.util.function.Function<java.lang.Throwable,S> unsupportedError) |
static BodyExtractor<<any>,ReactiveHttpInputMessage> |
toDataBuffers()
|
static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> |
toFlux(java.lang.Class<? extends T> elementClass)
Return a
BodyExtractor that reads into a Reactor Flux . |
static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> |
toFlux(ResolvableType elementType)
Return a
BodyExtractor that reads into a Reactor Flux . |
static BodyExtractor<<any>,ServerHttpRequest> |
toFormData()
Return a
BodyExtractor that reads form data into a MultiValueMap . |
static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> |
toMono(java.lang.Class<? extends T> elementClass)
Return a
BodyExtractor that reads into a Reactor Mono . |
static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> |
toMono(ResolvableType elementType)
Return a
BodyExtractor that reads into a Reactor Mono . |
private static final ResolvableType FORM_TYPE
public static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> toMono(java.lang.Class<? extends T> elementClass)
BodyExtractor
that reads into a Reactor Mono
.T
- the element typeelementClass
- the class of element in the Mono
BodyExtractor
that reads a monopublic static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> toMono(ResolvableType elementType)
BodyExtractor
that reads into a Reactor Mono
.T
- the element typeelementType
- the type of element in the Mono
BodyExtractor
that reads a monopublic static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> toFlux(java.lang.Class<? extends T> elementClass)
BodyExtractor
that reads into a Reactor Flux
.T
- the element typeelementClass
- the class of element in the Flux
BodyExtractor
that reads a monopublic static <T> BodyExtractor<<any>,ReactiveHttpInputMessage> toFlux(ResolvableType elementType)
BodyExtractor
that reads into a Reactor Flux
.T
- the element typeelementType
- the type of element in the Flux
BodyExtractor
that reads a monopublic static BodyExtractor<<any>,ServerHttpRequest> toFormData()
BodyExtractor
that reads form data into a MultiValueMap
.BodyExtractor
that reads form datapublic static BodyExtractor<<any>,ReactiveHttpInputMessage> toDataBuffers()
BodyExtractor
that returns the body of the message as a Flux
of
DataBuffer
s.
Note that the returned buffers should be released after usage by calling
DataBufferUtils.release(DataBuffer)
BodyExtractor
that returns the bodyReactiveHttpInputMessage.getBody()
private static <T,S extends <any>> S readWithMessageReaders(ReactiveHttpInputMessage inputMessage, BodyExtractor.Context context, ResolvableType elementType, java.util.function.Function<HttpMessageReader<T>,S> readerFunction, java.util.function.Function<java.lang.Throwable,S> unsupportedError)
private static HttpMessageReader<MultiValueMap<java.lang.String,java.lang.String>> formMessageReader(BodyExtractor.Context context)
private static MediaType contentType(HttpMessage message)
private static <T> HttpMessageReader<T> cast(HttpMessageReader<?> messageReader)