public interface StrategiesSupplier
HandlerFunctions. An instance of
this class is immutable; instances are typically created through the mutable StrategiesSupplier.Builder:
either through builder() to set up default strategies, or empty() to start from
scratch. Alternatively, StrategiesSupplier instances can be created through
of(Supplier, Supplier, Supplier).RouterFunctions.toHttpHandler(RouterFunction, StrategiesSupplier),
RouterFunctions.toHandlerMapping(RouterFunction, StrategiesSupplier)| Modifier and Type | Interface and Description |
|---|---|
static interface |
StrategiesSupplier.Builder
A mutable builder for a
StrategiesSupplier. |
| Modifier and Type | Method and Description |
|---|---|
static StrategiesSupplier.Builder |
builder()
Return a mutable builder for a
StrategiesSupplier with default initialization. |
static StrategiesSupplier.Builder |
builder(org.springframework.context.ApplicationContext applicationContext)
Return a mutable builder based on the given application context.
|
static StrategiesSupplier.Builder |
empty()
Return a mutable, empty builder for a
StrategiesSupplier. |
Supplier<Stream<org.springframework.http.codec.HttpMessageReader<?>>> |
messageReaders()
Supply a stream of
HttpMessageReaders to be used for request
body conversion. |
Supplier<Stream<org.springframework.http.codec.HttpMessageWriter<?>>> |
messageWriters()
Supply a stream of
HttpMessageWriters to be used for response
body conversion. |
static StrategiesSupplier |
of(org.springframework.context.ApplicationContext applicationContext)
Return a new
StrategiesSupplier based on the given
application context. |
static StrategiesSupplier |
of(Supplier<Stream<org.springframework.http.codec.HttpMessageReader<?>>> messageReaders,
Supplier<Stream<org.springframework.http.codec.HttpMessageWriter<?>>> messageWriters,
Supplier<Stream<ViewResolver>> viewResolvers)
Return a new
StrategiesSupplier described by the given supplier functions. |
Supplier<Stream<ViewResolver>> |
viewResolvers()
Supply a stream of
ViewResolvers to be used for view name
resolution. |
static StrategiesSupplier |
withDefaults()
Return a new
StrategiesSupplier with default initialization. |
Supplier<Stream<org.springframework.http.codec.HttpMessageReader<?>>> messageReaders()
HttpMessageReaders to be used for request
body conversion.Supplier<Stream<org.springframework.http.codec.HttpMessageWriter<?>>> messageWriters()
HttpMessageWriters to be used for response
body conversion.Supplier<Stream<ViewResolver>> viewResolvers()
ViewResolvers to be used for view name
resolution.static StrategiesSupplier withDefaults()
StrategiesSupplier with default initialization.StrategiesSupplierstatic StrategiesSupplier of(org.springframework.context.ApplicationContext applicationContext)
StrategiesSupplier based on the given
application context.
The returned supplier will search for all HttpMessageReader, HttpMessageWriter,
and ViewResolver instances in the given application context and return them for
messageReaders(), messageWriters(), and viewResolvers()
respectively.applicationContext - the application context to base the strategies onStrategiesSupplierstatic StrategiesSupplier of(Supplier<Stream<org.springframework.http.codec.HttpMessageReader<?>>> messageReaders, Supplier<Stream<org.springframework.http.codec.HttpMessageWriter<?>>> messageWriters, Supplier<Stream<ViewResolver>> viewResolvers)
StrategiesSupplier described by the given supplier functions.
All provided supplier function parameters can be null to indicate an empty
stream is to be returned.messageReaders - the supplier function for HttpMessageReader instances (can be null)messageWriters - the supplier function for HttpMessageWriter instances (can be null)viewResolvers - the supplier function for ViewResolver instances (can be null)StrategiesSupplierstatic StrategiesSupplier.Builder builder()
StrategiesSupplier with default initialization.static StrategiesSupplier.Builder builder(org.springframework.context.ApplicationContext applicationContext)
HttpMessageReader, HttpMessageWriter,
and ViewResolver instances in the given application context and return them for
messageReaders(), messageWriters(), and viewResolvers()
respectively.applicationContext - the application context to base the strategies onstatic StrategiesSupplier.Builder empty()
StrategiesSupplier.