Package io.javalin.router
Class JavalinDefaultRouting
-
- All Implemented Interfaces:
-
io.javalin.router.JavalinDefaultRoutingApi
,io.javalin.router.RoutingApi
public final class JavalinDefaultRouting implements JavalinDefaultRoutingApi<JavalinDefaultRouting>
-
-
Field Summary
Fields Modifier and Type Field Description public final static RoutingApiInitializer<JavalinDefaultRouting>
Default
-
Constructor Summary
Constructors Constructor Description JavalinDefaultRouting(JavalinConfig cfg)
-
Method Summary
Modifier and Type Method Description <E extends Exception> JavalinDefaultRouting
exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. JavalinDefaultRouting
error(Integer status, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. JavalinDefaultRouting
addEndpoint(Endpoint endpoint)
Adds a request handler for the specified handlerType and path to the instance. <E extends Exception> JavalinDefaultRouting
wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. JavalinDefaultRouting
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, 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> JavalinDefaultRouting exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. See: Exception mapping in docs
-
error
JavalinDefaultRouting 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
-
addEndpoint
JavalinDefaultRouting addEndpoint(Endpoint endpoint)
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> JavalinDefaultRouting wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. See: Exception mapping in docs
-
addWsHandler
JavalinDefaultRouting 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
-
-
-
-