Package net.officefloor.web.route
Class WebRouterBuilder
java.lang.Object
net.officefloor.web.route.WebRouterBuilder
Builds the
WebRouter.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRoute(HttpMethod method, String path, WebRouteHandler handler) Adds a route.build()Builds theWebRouter.static StringgetContextQualifiedPath(String contextPath, String path) Obtains the context qualified path.static booleanisPathParameters(String path) Indicates if the path contains parameters.
-
Constructor Details
-
WebRouterBuilder
Instantiate.- Parameters:
contextPath- Context path.
-
-
Method Details
-
isPathParameters
Indicates if the path contains parameters.- Parameters:
path- Path.- Returns:
trueshould the path contain parameters.
-
getContextQualifiedPath
Obtains the context qualified path.- Parameters:
contextPath- Context path. May benull.path- Path.- Returns:
- Context qualified path.
-
addRoute
Adds a route.- Parameters:
method-HttpMethod.path- Path. Use{param}to signify path parameters.handler-WebRouteHandlerfor the route.- Returns:
HttpInputPathfor the route.
-
build
Builds theWebRouter.- Returns:
WebRouter.
-