Improve Kotlin documentation
This commit is contained in:
@@ -25,18 +25,16 @@ import java.util.*
|
||||
import java.util.function.Supplier
|
||||
|
||||
/**
|
||||
* Allow to create easily a WebMvc.fn `RouterFunction<ServerResponse>` from a Kotlin router
|
||||
* DSL leveraging WebMvc.fn the Java API ([RouterFunction], [RequestPredicate],
|
||||
* [HandlerFunction]).
|
||||
* Allow to create easily a WebMvc.fn [RouterFunction] with a [Reactive router Kotlin DSL][RouterFunctionDsl].
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* @Configuration
|
||||
* class ApplicationRoutes(val userHandler: UserHandler) {
|
||||
* class RouterConfiguration {
|
||||
*
|
||||
* @Bean
|
||||
* fun mainRouter() = router {
|
||||
* fun mainRouter(userHandler: UserHandler) = router {
|
||||
* accept(TEXT_HTML).nest {
|
||||
* (GET("/user/") or GET("/users/")).invoke(userHandler::findAllView)
|
||||
* GET("/users/{login}", userHandler::findViewById)
|
||||
@@ -50,14 +48,12 @@ import java.util.function.Supplier
|
||||
* }
|
||||
* ```
|
||||
* @author Sebastien Deleuze
|
||||
* @see RouterFunctionDsl
|
||||
* @see RouterFunctions.Builder
|
||||
* @since 5.2
|
||||
*/
|
||||
fun router(routes: (RouterFunctionDsl.() -> Unit)) = RouterFunctionDsl(routes).build()
|
||||
|
||||
/**
|
||||
* Provide a WebMvc.fn [RouterFunction] Kotlin DSL in order to be able to write idiomatic Kotlin code.
|
||||
* Provide a WebMvc.fn [RouterFunction] Reactive Kotlin DSL created by [`router { }`][router] in order to be able to write idiomatic Kotlin code.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.2
|
||||
|
||||
Reference in New Issue
Block a user