-
- All Implemented Interfaces:
-
io.javalin.router.JavalinDefaultRoutingApi
,io.javalin.router.RoutingApi
public final class JavalinDefaultRouting implements JavalinDefaultRoutingApi<JavalinDefaultRouting>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
JavalinDefaultRouting.Companion
-
Constructor Summary
Constructors Constructor Description JavalinDefaultRouting(JavalinConfig cfg)
-
Method Summary
Modifier and Type Method Description <E extends Exception> <Error class: unknown class>
exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. <Error class: unknown class>
error(Integer status, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. <Error class: unknown class>
addHttpHandler(HandlerType handlerType, String path, Handler handler, RouteRole roles)
Adds a request handler for the specified handlerType and path to the instance. <E extends Exception> <Error class: unknown class>
wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. <Error class: unknown class>
addWsHandler(WsHandlerType handlerType, String path, Consumer<WsConfig> wsConfig, RouteRole roles)
Adds a WebSocket handler of the specified type on the specified path. -
Methods inherited from class io.javalin.router.JavalinDefaultRoutingApi
addHttpHandler, after, after, afterMatched, afterMatched, before, before, beforeMatched, beforeMatched, delete, delete, error, error, error, get, get, head, head, options, options, patch, patch, post, post, put, put, sse, sse, sse, ws, ws, wsAfter, wsAfter, wsAfterUpgrade, wsAfterUpgrade, wsBefore, wsBefore, wsBeforeUpgrade, wsBeforeUpgrade
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
JavalinDefaultRouting
JavalinDefaultRouting(JavalinConfig cfg)
-
-
Method Detail
-
exception
<E extends Exception> <Error class: unknown class> exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. See: Exception mapping in docs
-
error
<Error class: unknown class> error(Integer status, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages See: Error mapping in docs
-
addHttpHandler
<Error class: unknown class> addHttpHandler(HandlerType handlerType, String path, Handler handler, RouteRole roles)
Adds a request handler for the specified handlerType and path to the instance. This is the method that all the verb-methods (get/post/put/etc) call. See: Handlers in docs
-
wsException
<E extends Exception> <Error class: unknown class> wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. See: Exception mapping in docs
-
addWsHandler
<Error class: unknown class> addWsHandler(WsHandlerType handlerType, String path, Consumer<WsConfig> wsConfig, RouteRole roles)
Adds a WebSocket handler of the specified type on the specified path. See: WebSockets in docs
-
-
-
-