public class ApiBuilder
extends java.lang.Object
Javalin.routes(EndpointGroup)
Constructor and Description |
---|
ApiBuilder() |
Modifier and Type | Method and Description |
---|---|
static void |
after(Handler handler)
Adds a AFTER request handler for the current path to the
Javalin instance. |
static void |
after(java.lang.String path,
Handler handler)
Adds an AFTER request handler for the specified path to the
Javalin instance. |
static void |
before(Handler handler)
Adds a BEFORE request handler for the current path to the
Javalin instance. |
static void |
before(java.lang.String path,
Handler handler)
Adds a BEFORE request handler for the specified path to the
Javalin instance. |
static void |
clearStaticJavalin() |
static void |
crud(java.lang.String path,
io.javalin.apibuilder.CrudHandler crudHandler)
Adds a CrudHandler handler to the specified path to the instance.
|
static void |
crud(java.lang.String path,
io.javalin.apibuilder.CrudHandler crudHandler,
java.util.Set<Role> permittedRoles)
Adds a CrudHandler handler to the specified path with the given roles to the instance.
|
static void |
delete(Handler handler)
Adds a DELETE request handler for the current path to the
Javalin instance. |
static void |
delete(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a DELETE request handler with the given roles for the current path to the instance.
|
static void |
delete(java.lang.String path,
Handler handler)
Adds a DELETE request handler for the specified path to the
Javalin instance. |
static void |
delete(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a DELETE request handler with the given roles for the specified path to the instance.
|
static void |
get(Handler handler)
Adds a GET request handler for the current path to the
Javalin instance. |
static void |
get(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a GET request handler with the given roles for the current path to the instance.
|
static void |
get(java.lang.String path,
Handler handler)
Adds a GET request handler for the specified path to the
Javalin instance. |
static void |
get(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a GET request handler with the given roles for the specified path to the instance.
|
static void |
head(Handler handler)
Adds a HEAD request handler for the current path to the
Javalin instance. |
static void |
head(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a HEAD request handler with the given roles for the current path to the instance.
|
static void |
head(java.lang.String path,
Handler handler)
Adds a HEAD request handler for the specified path to the
Javalin instance. |
static void |
head(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a HEAD request handler with the given roles for the specified path to the instance.
|
static void |
patch(Handler handler)
Adds a PATCH request handler for the current path to the
Javalin instance. |
static void |
patch(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a PATCH request handler with the given roles for the current path to the instance.
|
static void |
patch(java.lang.String path,
Handler handler)
Adds a PATCH request handler for the specified path to the
Javalin instance. |
static void |
patch(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a PATCH request handler with the given roles for the specified path to the instance.
|
static void |
path(java.lang.String path,
EndpointGroup endpointGroup)
Prefixes all handlers defined in its scope with the specified path.
|
static void |
post(Handler handler)
Adds a POST request handler for the current path to the
Javalin instance. |
static void |
post(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a POST request handler with the given roles for the current path to the instance.
|
static void |
post(java.lang.String path,
Handler handler)
Adds a POST request handler for the specified path to the
Javalin instance. |
static void |
post(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a POST request handler with the given roles for the specified path to the instance.
|
static void |
put(Handler handler)
Adds a PUT request handler for the current path to the
Javalin instance. |
static void |
put(Handler handler,
java.util.Set<Role> permittedRoles)
Adds a PUT request handler with the given roles for the current path to the instance.
|
static void |
put(java.lang.String path,
Handler handler)
Adds a PUT request handler for the specified path to the
Javalin instance. |
static void |
put(java.lang.String path,
Handler handler,
java.util.Set<Role> permittedRoles)
Adds a PUT request handler with the given roles for the specified path to the instance.
|
static void |
setStaticJavalin(Javalin javalin) |
static void |
sse(java.util.function.Consumer<SseClient> client) |
static void |
sse(java.util.function.Consumer<SseClient> client,
java.util.Set<Role> permittedRoles) |
static void |
sse(java.lang.String path,
java.util.function.Consumer<SseClient> client) |
static void |
sse(java.lang.String path,
java.util.function.Consumer<SseClient> client,
java.util.Set<Role> permittedRoles) |
static void |
ws(java.util.function.Consumer<WsHandler> ws)
Adds a WebSocket handler on the current path.
|
static void |
ws(java.util.function.Consumer<WsHandler> ws,
java.util.Set<Role> permittedRoles)
Adds a WebSocket handler with the given roles for the current path.
|
static void |
ws(java.lang.String path,
java.util.function.Consumer<WsHandler> ws)
Adds a WebSocket handler on the specified path.
|
static void |
ws(java.lang.String path,
java.util.function.Consumer<WsHandler> ws,
java.util.Set<Role> permittedRoles)
Adds a WebSocket handler with the given roles for the specified path.
|
Javalin |
wsAfter(java.util.function.Consumer<WsHandler> wsHandler)
Adds a WebSocket after handler for the current path to the
Javalin instance. |
Javalin |
wsAfter(java.lang.String path,
java.util.function.Consumer<WsHandler> wsHandler)
Adds a WebSocket after handler for the specified path to the
Javalin instance. |
Javalin |
wsBefore(java.util.function.Consumer<WsHandler> wsHandler)
Adds a WebSocket before handler for the current path to the
Javalin instance. |
Javalin |
wsBefore(java.lang.String path,
java.util.function.Consumer<WsHandler> wsHandler)
Adds a WebSocket before handler for the specified path to the
Javalin instance. |
public static void setStaticJavalin(@NotNull Javalin javalin)
public static void clearStaticJavalin()
public static void path(@NotNull java.lang.String path, @NotNull EndpointGroup endpointGroup)
Javalin.routes(EndpointGroup)
.public static void get(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void get(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void get(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void get(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void post(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void post(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void post(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void post(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void put(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void put(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void put(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void put(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void patch(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void patch(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void patch(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void patch(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void delete(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void delete(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void delete(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void delete(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void head(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void head(@NotNull java.lang.String path, @NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void head(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void head(@NotNull Handler handler, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.AccessManager
,
Handlers in docspublic static void before(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void before(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void after(@NotNull java.lang.String path, @NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void after(@NotNull Handler handler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void ws(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<WsHandler> ws)
Javalin.routes(EndpointGroup)
.public static void ws(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<WsHandler> ws, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.public static void ws(@NotNull java.util.function.Consumer<WsHandler> ws)
Javalin.routes(EndpointGroup)
.public static void ws(@NotNull java.util.function.Consumer<WsHandler> ws, @NotNull java.util.Set<Role> permittedRoles)
Javalin.routes(EndpointGroup)
.public Javalin wsBefore(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<WsHandler> wsHandler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public Javalin wsBefore(@NotNull java.util.function.Consumer<WsHandler> wsHandler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public Javalin wsAfter(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<WsHandler> wsHandler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public Javalin wsAfter(@NotNull java.util.function.Consumer<WsHandler> wsHandler)
Javalin
instance.
The method can only be called inside a Javalin.routes(EndpointGroup)
.public static void sse(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<SseClient> client)
public static void sse(@NotNull java.lang.String path, @NotNull java.util.function.Consumer<SseClient> client, @NotNull java.util.Set<Role> permittedRoles)
public static void sse(@NotNull java.util.function.Consumer<SseClient> client)
public static void sse(@NotNull java.util.function.Consumer<SseClient> client, @NotNull java.util.Set<Role> permittedRoles)
public static void crud(@NotNull java.lang.String path, @NotNull io.javalin.apibuilder.CrudHandler crudHandler)
CrudHandler
public static void crud(@NotNull java.lang.String path, @NotNull io.javalin.apibuilder.CrudHandler crudHandler, @NotNull java.util.Set<Role> permittedRoles)
CrudHandler
Copyright © 2019. All Rights Reserved.