Package com.vaadin.hilla.route
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns all registered routes.getRouteByPath(String path) Gets the client view configuration for the given route.booleanGets whether the registry has a main layout.voidloadLatestDevModeFileRoutesJsonIfNeeded(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration) voidregisterClientRoutes(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, LocalDateTime lastUpdated) Registers client routes from file-routes.json file generated by the file-router's Vite plugin.
-
Field Details
-
FILE_ROUTES_JSON_NAME
- See Also:
-
FILE_ROUTES_JSON_PROD_PATH
- See Also:
-
-
Constructor Details
-
ClientRouteRegistry
public ClientRouteRegistry()
-
-
Method Details
-
getAllRoutes
Returns all registered routes.- Returns:
- a map of all registered routes
-
getRouteByPath
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 configurationlastUpdated- 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:
trueif the registry has a main layout,falseotherwise
-
getClientRoutes
- Specified by:
getClientRoutesin interfacecom.vaadin.flow.router.internal.ClientRoutesProvider
-