Class PathMatchingRouterBuilder
- java.lang.Object
-
- org.glassfish.jersey.server.internal.routing.PathMatchingRouterBuilder
-
- All Implemented Interfaces:
PathToRouterBuilder
final class PathMatchingRouterBuilder extends java.lang.Object implements PathToRouterBuilder
/** A request path pattern matching router hierarchy builder entry point.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Route>
acceptedRoutes
private java.util.List<Router>
currentRouters
-
Constructor Summary
Constructors Modifier Constructor Description private
PathMatchingRouterBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<Route>
acceptedRoutes()
Get the list of the registered sub-routes.PathMatchingRouter
build()
(package private) static PathToRouterBuilder
newRoute(PathPattern pattern)
Create new request path pattern matching router builder.PathToRouterBuilder
route(PathPattern pattern)
Complete the currently built unfinished sub-route (if any) and start building a new one.private void
startNewRoute(PathPattern pattern)
PathMatchingRouterBuilder
to(Router router)
Register a new next-level router to be used for request routing in case the routing pattern matches the unmatched right-hand part of the request path.
-
-
-
Method Detail
-
newRoute
static PathToRouterBuilder newRoute(PathPattern pattern)
Create new request path pattern matching router builder.- Parameters:
pattern
- request path matching pattern.- Returns:
- new request path pattern matching router builder.
-
startNewRoute
private void startNewRoute(PathPattern pattern)
-
acceptedRoutes
protected java.util.List<Route> acceptedRoutes()
Get the list of the registered sub-routes.- Returns:
- list of the registered sub-routes.
-
to
public PathMatchingRouterBuilder to(Router router)
Description copied from interface:PathToRouterBuilder
Register a new next-level router to be used for request routing in case the routing pattern matches the unmatched right-hand part of the request path.- Specified by:
to
in interfacePathToRouterBuilder
- Parameters:
router
- new next-level router to be registered with the routed path pattern.- Returns:
- updated route builder ready to build a new
router
instance (or add more routes to the currently built one).
-
route
public PathToRouterBuilder route(PathPattern pattern)
Complete the currently built unfinished sub-route (if any) and start building a new one. The completed sub-route is added to the list of the routes accepted by the router that is being built.- Parameters:
pattern
- routing pattern for the new sub-route.- Returns:
- updated router builder.
-
build
public PathMatchingRouter build()
- Returns:
- hierarchical request path matching processor (i.e. router).
-
-