Class PathMatchingRouterBuilder

java.lang.Object
org.glassfish.jersey.server.internal.routing.PathMatchingRouterBuilder
All Implemented Interfaces:
PathToRouterBuilder

final class PathMatchingRouterBuilder extends Object implements PathToRouterBuilder
/** A request path pattern matching router hierarchy builder entry point.
  • Field Details

    • acceptedRoutes

      private final List<Route> acceptedRoutes
    • currentRouters

      private List<Router> currentRouters
  • Constructor Details

    • PathMatchingRouterBuilder

      private PathMatchingRouterBuilder()
  • Method Details

    • 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 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 interface PathToRouterBuilder
      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).