Class WebRouterBuilder

java.lang.Object
net.officefloor.web.route.WebRouterBuilder

public class WebRouterBuilder extends Object
Builds the WebRouter.
Author:
Daniel Sagenschneider
  • Constructor Details

    • WebRouterBuilder

      public WebRouterBuilder(String contextPath)
      Instantiate.
      Parameters:
      contextPath - Context path.
  • Method Details

    • isPathParameters

      public static boolean isPathParameters(String path)
      Indicates if the path contains parameters.
      Parameters:
      path - Path.
      Returns:
      true should the path contain parameters.
    • getContextQualifiedPath

      public static String getContextQualifiedPath(String contextPath, String path)
      Obtains the context qualified path.
      Parameters:
      contextPath - Context path. May be null.
      path - Path.
      Returns:
      Context qualified path.
    • addRoute

      public HttpInputPath addRoute(HttpMethod method, String path, WebRouteHandler handler)
      Adds a route.
      Parameters:
      method - HttpMethod.
      path - Path. Use {param} to signify path parameters.
      handler - WebRouteHandler for the route.
      Returns:
      HttpInputPath for the route.
    • build

      public WebRouter build()
      Builds the WebRouter.
      Returns:
      WebRouter.