Class RouteTable

java.lang.Object
megalodonte.base.route.RouteTable

public final class RouteTable extends Object
Stores the route definitions and the entrypoint. Owns route matching, so both the router (navigation) and ScreenContextBase (spawn) resolve routes through the same registry.
  • Constructor Details

    • RouteTable

      public RouteTable(Set<Route> routes, String entrypoint)
  • Method Details

    • entrypoint

      public String entrypoint()
    • routes

      public Set<Route> routes()
    • resolve

      public RouteTable.ResolvedRoute resolve(String path)
      Resolves the given path against the registered routes, extracting dynamic segment parameters (${name}).
      Parameters:
      path - the route identification to resolve (e.g. "user/123")
      Returns:
      the matched route and its parameters
      Throws:
      RouteNotFoundException - if no route matches the given path