public class ApiBuilder extends 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(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(String path,
Handler handler)
Adds a BEFORE request handler for the specified path to the
Javalin instance. |
static void |
clearStaticJavalin() |
static void |
crud(io.javalin.apibuilder.CrudHandler crudHandler)
Adds a CrudHandler handler to the current path to the
Javalin instance. |
static void |
crud(io.javalin.apibuilder.CrudHandler crudHandler,
RouteRole... roles)
Adds a CrudHandler handler to the current path with the given roles to the
Javalin instance. |
static void |
crud(String path,
io.javalin.apibuilder.CrudHandler crudHandler)
Adds a CrudHandler handler to the specified path to the
Javalin instance. |
static void |
crud(String path,
io.javalin.apibuilder.CrudHandler crudHandler,
RouteRole... roles)
Adds a CrudHandler handler to the specified path with the given roles to the
Javalin instance. |
static void |
delete(Handler handler)
Adds a DELETE request handler for the current path to the
Javalin instance. |
static void |
delete(Handler handler,
RouteRole... roles)
Adds a DELETE request handler with the given roles for the current path to the instance.
|
static void |
delete(String path,
Handler handler)
Adds a DELETE request handler for the specified path to the
Javalin instance. |
static void |
delete(String path,
Handler handler,
RouteRole... roles)
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,
RouteRole... roles)
Adds a GET request handler with the given roles for the current path to the instance.
|
static void |
get(String path,
Handler handler)
Adds a GET request handler for the specified path to the
Javalin instance. |
static void |
get(String path,
Handler handler,
RouteRole... roles)
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,
RouteRole... roles)
Adds a HEAD request handler with the given roles for the current path to the instance.
|
static void |
head(String path,
Handler handler)
Adds a HEAD request handler for the specified path to the
Javalin instance. |
static void |
head(String path,
Handler handler,
RouteRole... roles)
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,
RouteRole... roles)
Adds a PATCH request handler with the given roles for the current path to the instance.
|
static void |
patch(String path,
Handler handler)
Adds a PATCH request handler for the specified path to the
Javalin instance. |
static void |
patch(String path,
Handler handler,
RouteRole... roles)
Adds a PATCH request handler with the given roles for the specified path to the instance.
|
static void |
path(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,
RouteRole... roles)
Adds a POST request handler with the given roles for the current path to the instance.
|
static void |
post(String path,
Handler handler)
Adds a POST request handler for the specified path to the
Javalin instance. |
static void |
post(String path,
Handler handler,
RouteRole... roles)
Adds a POST request handler with the given roles for the specified path to the instance.
|
static String |
prefixPath(String path) |
static void |
put(Handler handler)
Adds a PUT request handler for the current path to the
Javalin instance. |
static void |
put(Handler handler,
RouteRole... roles)
Adds a PUT request handler with the given roles for the current path to the instance.
|
static void |
put(String path,
Handler handler)
Adds a PUT request handler for the specified path to the
Javalin instance. |
static void |
put(String path,
Handler handler,
RouteRole... roles)
Adds a PUT request handler with the given roles for the specified path to the instance.
|
static void |
setStaticJavalin(Javalin javalin) |
static void |
sse(Consumer<io.javalin.http.sse.SseClient> client) |
static void |
sse(Consumer<io.javalin.http.sse.SseClient> client,
RouteRole... roles) |
static void |
sse(String path,
Consumer<io.javalin.http.sse.SseClient> client) |
static void |
sse(String path,
Consumer<io.javalin.http.sse.SseClient> client,
RouteRole... roles) |
static Javalin |
staticInstance() |
static void |
ws(Consumer<WsConfig> ws)
Adds a WebSocket handler on the current path.
|
static void |
ws(Consumer<WsConfig> ws,
RouteRole... roles)
Adds a WebSocket handler with the given roles for the current path.
|
static void |
ws(String path,
Consumer<WsConfig> ws)
Adds a WebSocket handler on the specified path.
|
static void |
ws(String path,
Consumer<WsConfig> ws,
RouteRole... roles)
Adds a WebSocket handler with the given roles for the specified path.
|
Javalin |
wsAfter(Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for the current path to the
Javalin instance. |
Javalin |
wsAfter(String path,
Consumer<WsConfig> wsConfig)
Adds a WebSocket after handler for the specified path to the
Javalin instance. |
Javalin |
wsBefore(Consumer<WsConfig> wsConfig)
Adds a WebSocket before handler for the current path to the
Javalin instance. |
Javalin |
wsBefore(String path,
Consumer<WsConfig> wsConfig)
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
String path,
@NotNull
EndpointGroup endpointGroup)
Javalin.routes(EndpointGroup).public static Javalin staticInstance()
public static void get(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void get(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void post(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void post(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void put(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void put(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void patch(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void patch(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void delete(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void delete(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void head(@NotNull
String path,
@NotNull
Handler handler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void head(@NotNull
String path,
@NotNull
Handler handler,
@NotNull
RouteRole... roles)
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
RouteRole... roles)
Javalin.routes(EndpointGroup).AccessManager,
Handlers in docspublic static void before(@NotNull
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
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
String path,
@NotNull
Consumer<WsConfig> ws)
Javalin.routes(EndpointGroup).public static void ws(@NotNull
String path,
@NotNull
Consumer<WsConfig> ws,
@NotNull
RouteRole... roles)
Javalin.routes(EndpointGroup).public static void ws(@NotNull
Consumer<WsConfig> ws)
Javalin.routes(EndpointGroup).public static void ws(@NotNull
Consumer<WsConfig> ws,
@NotNull
RouteRole... roles)
Javalin.routes(EndpointGroup).public Javalin wsBefore(@NotNull String path, @NotNull Consumer<WsConfig> wsConfig)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public Javalin wsBefore(@NotNull Consumer<WsConfig> wsConfig)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public Javalin wsAfter(@NotNull String path, @NotNull Consumer<WsConfig> wsConfig)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public Javalin wsAfter(@NotNull Consumer<WsConfig> wsConfig)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void sse(@NotNull
String path,
@NotNull
Consumer<io.javalin.http.sse.SseClient> client)
public static void sse(@NotNull
String path,
@NotNull
Consumer<io.javalin.http.sse.SseClient> client,
@NotNull
RouteRole... roles)
public static void sse(@NotNull
Consumer<io.javalin.http.sse.SseClient> client)
public static void sse(@NotNull
Consumer<io.javalin.http.sse.SseClient> client,
@NotNull
RouteRole... roles)
public static void crud(@NotNull
io.javalin.apibuilder.CrudHandler crudHandler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void crud(@NotNull
io.javalin.apibuilder.CrudHandler crudHandler,
@NotNull
RouteRole... roles)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).public static void crud(@NotNull
String path,
@NotNull
io.javalin.apibuilder.CrudHandler crudHandler)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).CrudHandlerpublic static void crud(@NotNull
String path,
@NotNull
io.javalin.apibuilder.CrudHandler crudHandler,
@NotNull
RouteRole... roles)
Javalin instance.
The method can only be called inside a Javalin.routes(EndpointGroup).CrudHandlerCopyright © 2021. All rights reserved.