Package net.officefloor.web.route
Class WebRouterBuilder
- java.lang.Object
-
- net.officefloor.web.route.WebRouterBuilder
-
public class WebRouterBuilder extends java.lang.Object
Builds theWebRouter
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description WebRouterBuilder(java.lang.String contextPath)
Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpInputPath
addRoute(HttpMethod method, java.lang.String path, WebRouteHandler handler)
Adds a route.WebRouter
build()
Builds theWebRouter
.static java.lang.String
getContextQualifiedPath(java.lang.String contextPath, java.lang.String path)
Obtains the context qualified path.static boolean
isPathParameters(java.lang.String path)
Indicates if the path contains parameters.
-
-
-
Method Detail
-
isPathParameters
public static boolean isPathParameters(java.lang.String path)
Indicates if the path contains parameters.- Parameters:
path
- Path.- Returns:
true
should the path contain parameters.
-
getContextQualifiedPath
public static java.lang.String getContextQualifiedPath(java.lang.String contextPath, java.lang.String path)
Obtains the context qualified path.- Parameters:
contextPath
- Context path. May benull
.path
- Path.- Returns:
- Context qualified path.
-
addRoute
public HttpInputPath addRoute(HttpMethod method, java.lang.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.
-
-