All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.javalin.router.ParsedEndpoint.kt Maven / Gradle / Ivy

There is a newer version: 6.3.0
Show newest version
package io.javalin.router

import io.javalin.config.RouterConfig
import io.javalin.http.servlet.JavalinServletContext
import io.javalin.router.matcher.PathParser

class ParsedEndpoint(
    val endpoint: Endpoint,
    routerConfig: RouterConfig,
) {

    private val pathParser = PathParser(endpoint.path, routerConfig)

    fun handle(ctx: JavalinServletContext, requestUri: String) {
        endpoint.handle(ctx.update(this, requestUri))
    }

    fun matches(requestUri: String): Boolean =
        pathParser.matches(requestUri)

    fun extractPathParams(requestUri: String): Map =
        pathParser.extractPathParams(requestUri)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy