com.vaadin.hilla.route.

Class RouteUtil

java.lang.Object
com.vaadin.hilla.route.RouteUtil

All Implemented Interfaces:

FileRouterRequestUtil

@Component public class RouteUtil extends Object implements FileRouterRequestUtil

A container for utility methods related with Routes.

For internal use only. May be renamed or removed in a future release.

  • Constructor Details

    • RouteUtil

      public RouteUtil()
  • Method Details

    • setRoutes

      public void setRoutes(Map<String,AvailableViewInfo> registeredRoutes)

      Initializes a new instance of the RouteUtil class with the given route map.

      Parameters:

      registeredRoutes - - the available unfiltered routes

    • isRouteAllowed

      public boolean isRouteAllowed(jakarta.servlet.http.HttpServletRequest request)

      Checks if the given request is allowed route to the user.

      Specified by:

      isRouteAllowed in interface FileRouterRequestUtil

      Parameters:

      request - the HTTP request to check

      Returns:

      true if the request goes allowed route, false otherwise

    • removeChildren

      public static void removeChildren(Map<String,AvailableViewInfo> configurations, AvailableViewInfo viewInfo, String parentPath)
    • getRouteByPath

      protected AvailableViewInfo getRouteByPath(Map<String,AvailableViewInfo> availableRoutes, 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