-
- All Implemented Interfaces:
-
io.javalin.router.RoutingApi
public interface JavalinDefaultRoutingApi<API extends RoutingApi> implements RoutingApi
-
-
Method Summary
Modifier and Type Method Description abstract <E extends Exception> API
exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. API
error(HttpStatus status, Handler handler)
Adds an error mapper to the instance. API
error(Integer status, Handler handler)
Adds an error mapper to the instance. API
error(HttpStatus status, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. abstract API
error(Integer status, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. abstract API
addHttpHandler(HandlerType handlerType, String path, Handler handler, RouteRole roles)
Adds a request handler for the specified handlerType and path to the instance. API
addHttpHandler(HandlerType httpMethod, String path, Handler handler)
Adds a request handler for the specified handlerType and path to the instance. API
get(String path, Handler handler)
Adds a GET request handler for the specified path to the instance. API
get(String path, Handler handler, RouteRole roles)
Adds a GET request handler with the given roles for the specified path to the instance. API
post(String path, Handler handler)
Adds a POST request handler for the specified path to the instance. API
post(String path, Handler handler, RouteRole roles)
Adds a POST request handler with the given roles for the specified path to the instance. API
put(String path, Handler handler)
Adds a PUT request handler for the specified path to the instance. API
put(String path, Handler handler, RouteRole roles)
Adds a PUT request handler with the given roles for the specified path to the instance. API
patch(String path, Handler handler)
Adds a PATCH request handler for the specified path to the instance. API
patch(String path, Handler handler, RouteRole roles)
Adds a PATCH request handler with the given roles for the specified path to the instance. API
delete(String path, Handler handler)
Adds a DELETE request handler for the specified path to the instance. API
delete(String path, Handler handler, RouteRole roles)
Adds a DELETE request handler with the given roles for the specified path to the instance. API
head(String path, Handler handler)
Adds a HEAD request handler for the specified path to the instance. API
head(String path, Handler handler, RouteRole roles)
Adds a HEAD request handler with the given roles for the specified path to the instance. API
options(String path, Handler handler)
Adds a OPTIONS request handler for the specified path to the instance. API
options(String path, Handler handler, RouteRole roles)
Adds a OPTIONS request handler with the given roles for the specified path to the instance. API
sse(String path, Consumer<SseClient> client)
Adds a lambda handler for a Server Sent Event connection on the specified path. API
sse(String path, SseHandler handler)
Adds a lambda handler for a Server Sent Event connection on the specified path. API
sse(String path, Consumer<SseClient> client, RouteRole roles)
Adds a lambda handler for a Server Sent Event connection on the specified path. API
before(String path, Handler handler)
Adds a BEFORE request handler for the specified path to the instance. API
before(Handler handler)
Adds a BEFORE request handler for all routes in the instance. API
beforeMatched(String path, Handler handler)
Adds a BEFORE_MATCHED request handler for the specified path to the instance. API
beforeMatched(Handler handler)
Adds a BEFORE_MATCHED request handler for all routes in the instance. API
after(String path, Handler handler)
Adds an AFTER request handler for the specified path to the instance. API
after(Handler handler)
Adds an AFTER request handler for all routes in the instance. API
afterMatched(String path, Handler handler)
Adds an AFTER_MATCHED request handler for the specified path to the instance. API
afterMatched(Handler handler)
Adds an AFTER_MATCHED request handler for all routes in the instance. abstract <E extends Exception> API
wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. abstract API
addWsHandler(WsHandlerType handlerType, String path, Consumer<WsConfig> wsConfig, RouteRole roles)
Adds a WebSocket handler of the specified type on the specified path. API
ws(String path, Consumer<WsConfig> ws)
Adds a WebSocket handler on the specified path. API
ws(String path, Consumer<WsConfig> ws, RouteRole roles)
Adds a WebSocket handler on the specified path with the specified roles. API
wsBefore(String path, Consumer<WsConfig> wsConfig)
Adds a WebSocket before handler for the specified path to the instance. API
wsBefore(Consumer<WsConfig> wsConfig)
Adds a WebSocket before handler for all routes in the instance. API
wsBeforeUpgrade(String path, Handler handler)
Adds a WebSocket before upgrade handler for the specified path to the instance. API
wsBeforeUpgrade(Handler handler)
Adds a WebSocket before upgrade handler for all routes in the instance. API
wsAfter(String path, Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for the specified path to the instance. API
wsAfter(Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for all routes in the instance. API
wsAfterUpgrade(String path, Handler handler)
Adds a WebSocket after upgrade handler for the specified path to the instance. API
wsAfterUpgrade(Handler handler)
Adds a WebSocket after upgrade handler for all routes in the instance. -
-
Method Detail
-
exception
abstract <E extends Exception> API exception(Class<E> exceptionClass, ExceptionHandler<in E> exceptionHandler)
Adds an exception mapper to the instance. See: Exception mapping in docs
-
error
API error(HttpStatus status, Handler handler)
Adds an error mapper to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages See: Error mapping in docs
-
error
API error(Integer status, Handler handler)
Adds an error mapper to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages See: Error mapping in docs
-
error
API error(HttpStatus 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
-
error
abstract API 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
abstract API 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
-
addHttpHandler
API addHttpHandler(HandlerType httpMethod, String path, Handler handler)
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
-
get
API get(String path, Handler handler)
Adds a GET request handler for the specified path to the instance. See: Handlers in docs
-
get
API get(String path, Handler handler, RouteRole roles)
Adds a GET request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
post
API post(String path, Handler handler)
Adds a POST request handler for the specified path to the instance. See: Handlers in docs
-
post
API post(String path, Handler handler, RouteRole roles)
Adds a POST request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
put
API put(String path, Handler handler)
Adds a PUT request handler for the specified path to the instance. See: Handlers in docs
-
put
API put(String path, Handler handler, RouteRole roles)
Adds a PUT request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
patch
API patch(String path, Handler handler)
Adds a PATCH request handler for the specified path to the instance. See: Handlers in docs
-
patch
API patch(String path, Handler handler, RouteRole roles)
Adds a PATCH request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
delete
API delete(String path, Handler handler)
Adds a DELETE request handler for the specified path to the instance. See: Handlers in docs
-
delete
API delete(String path, Handler handler, RouteRole roles)
Adds a DELETE request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
head
API head(String path, Handler handler)
Adds a HEAD request handler for the specified path to the instance. See: Handlers in docs
-
head
API head(String path, Handler handler, RouteRole roles)
Adds a HEAD request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
options
API options(String path, Handler handler)
Adds a OPTIONS request handler for the specified path to the instance. See: Handlers in docs
-
options
API options(String path, Handler handler, RouteRole roles)
Adds a OPTIONS request handler with the given roles for the specified path to the instance. See: Handlers in docs
-
sse
API sse(String path, Consumer<SseClient> client)
Adds a lambda handler for a Server Sent Event connection on the specified path.
-
sse
API sse(String path, SseHandler handler)
Adds a lambda handler for a Server Sent Event connection on the specified path.
-
sse
API sse(String path, Consumer<SseClient> client, RouteRole roles)
Adds a lambda handler for a Server Sent Event connection on the specified path.
-
before
API before(String path, Handler handler)
Adds a BEFORE request handler for the specified path to the instance. See: Handlers in docs
-
before
API before(Handler handler)
Adds a BEFORE request handler for all routes in the instance. See: Handlers in docs
-
beforeMatched
API beforeMatched(String path, Handler handler)
Adds a BEFORE_MATCHED request handler for the specified path to the instance. See: Handlers in docs
-
beforeMatched
API beforeMatched(Handler handler)
Adds a BEFORE_MATCHED request handler for all routes in the instance. See: Handlers in docs
-
after
API after(String path, Handler handler)
Adds an AFTER request handler for the specified path to the instance. See: Handlers in docs
-
after
API after(Handler handler)
Adds an AFTER request handler for all routes in the instance. See: Handlers in docs
-
afterMatched
API afterMatched(String path, Handler handler)
Adds an AFTER_MATCHED request handler for the specified path to the instance. See: Handlers in docs
-
afterMatched
API afterMatched(Handler handler)
Adds an AFTER_MATCHED request handler for all routes in the instance. See: Handlers in docs
-
wsException
abstract <E extends Exception> API wsException(Class<E> exceptionClass, WsExceptionHandler<in E> exceptionHandler)
Adds a WebSocket exception mapper to the instance. See: Exception mapping in docs
-
addWsHandler
abstract API 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
-
ws
API ws(String path, Consumer<WsConfig> ws)
Adds a WebSocket handler on the specified path. See: WebSockets in docs
-
ws
API ws(String path, Consumer<WsConfig> ws, RouteRole roles)
Adds a WebSocket handler on the specified path with the specified roles. See: WebSockets in docs
-
wsBefore
API wsBefore(String path, Consumer<WsConfig> wsConfig)
Adds a WebSocket before handler for the specified path to the instance.
-
wsBefore
API wsBefore(Consumer<WsConfig> wsConfig)
Adds a WebSocket before handler for all routes in the instance.
-
wsBeforeUpgrade
API wsBeforeUpgrade(String path, Handler handler)
Adds a WebSocket before upgrade handler for the specified path to the instance.
-
wsBeforeUpgrade
API wsBeforeUpgrade(Handler handler)
Adds a WebSocket before upgrade handler for all routes in the instance.
-
wsAfter
API wsAfter(String path, Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for the specified path to the instance.
-
wsAfter
API wsAfter(Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for all routes in the instance.
-
wsAfterUpgrade
API wsAfterUpgrade(String path, Handler handler)
Adds a WebSocket after upgrade handler for the specified path to the instance.
-
wsAfterUpgrade
API wsAfterUpgrade(Handler handler)
Adds a WebSocket after upgrade handler for all routes in the instance.
-
-
-
-