Class ApiBuilder

    • Constructor Summary

      Constructors 
      Constructor Description
      ApiBuilder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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​(String path, Consumer<io.javalin.http.sse.SseClient> client)  
      static void sse​(String path, Consumer<io.javalin.http.sse.SseClient> client, RouteRole... roles)  
      static void sse​(Consumer<io.javalin.http.sse.SseClient> client)  
      static void sse​(Consumer<io.javalin.http.sse.SseClient> client, RouteRole... roles)  
      static Javalin staticInstance()  
      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.
      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.
      Javalin wsAfter​(String path, Consumer<WsConfig> wsConfig)
      Adds a WebSocket after handler for the specified path to the Javalin instance.
      Javalin wsAfter​(Consumer<WsConfig> wsConfig)
      Adds a WebSocket after 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.
      Javalin wsBefore​(Consumer<WsConfig> wsConfig)
      Adds a WebSocket before handler for the current path to the Javalin instance.