Class ClientRouteRegistry

java.lang.Object
com.vaadin.hilla.route.ClientRouteRegistry
All Implemented Interfaces:
com.vaadin.flow.router.internal.ClientRoutesProvider, Serializable

@Component public class ClientRouteRegistry extends Object implements com.vaadin.flow.router.internal.ClientRoutesProvider
Keeps track of registered client side routes.
See Also:
  • Field Details

  • Constructor Details

    • ClientRouteRegistry

      public ClientRouteRegistry()
  • Method Details

    • getAllRoutes

      public Map<String,ClientViewConfig> getAllRoutes()
      Returns all registered routes.
      Returns:
      a map of all registered routes
    • getRouteByPath

      public ClientViewConfig getRouteByPath(String path)
      Gets the client view configuration for the given route.
      Parameters:
      path - the URL path to get the client view configuration for
      Returns:
      - the client view configuration for the given route
    • registerClientRoutes

      public void registerClientRoutes(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, LocalDateTime lastUpdated)
      Registers client routes from file-routes.json file generated by the file-router's Vite plugin. The file-routes.json file is expected to be in the frontend/generated folder in dev mode and in the META-INF/VAADIN folder in production mode.
      Parameters:
      deploymentConfiguration - the deployment configuration
      lastUpdated - the time of latest loading of the file-routes.json
    • loadLatestDevModeFileRoutesJsonIfNeeded

      public void loadLatestDevModeFileRoutesJsonIfNeeded(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration)
    • hasMainLayout

      public boolean hasMainLayout()
      Gets whether the registry has a main layout.
      Returns:
      true if the registry has a main layout, false otherwise
    • getClientRoutes

      public List<String> getClientRoutes()
      Specified by:
      getClientRoutes in interface com.vaadin.flow.router.internal.ClientRoutesProvider