Package net.officefloor.web.route
Class WebRouterBuilder
- java.lang.Object
-
- net.officefloor.web.route.WebRouterBuilder
-
public class WebRouterBuilder extends java.lang.ObjectBuilds 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 HttpInputPathaddRoute(HttpMethod method, java.lang.String path, WebRouteHandler handler)Adds a route.WebRouterbuild()Builds theWebRouter.static java.lang.StringgetContextQualifiedPath(java.lang.String contextPath, java.lang.String path)Obtains the context qualified path.static booleanisPathParameters(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:
trueshould 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-WebRouteHandlerfor the route.- Returns:
HttpInputPathfor the route.
-
-