com.vaadin.flow.router.
Class Router
All Implemented Interfaces:
The router takes care of serving content when the user navigates within a site or an application.
Since:
1.0.
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRouter
(RouteRegistry registry) Constructs a new router with the given route registry and a
DefaultRouteResolver
. -
Method Summary
Modifier and TypeMethodDescriptiongetErrorNavigationTarget
(Exception exception) Get a registered navigation target for given exception.
void
initializeUI
(UI ui, Location location) Enables navigation for a new UI instance.
int
navigate
(UI ui, Location location, NavigationTrigger trigger) Navigates the given UI to the given location.
int
navigate
(UI ui, Location location, NavigationTrigger trigger, elemental.json.JsonValue state) Navigates the given UI to the given location.
int
navigate
(UI ui, Location location, NavigationTrigger trigger, elemental.json.JsonValue state, boolean forceInstantiation, boolean recreateLayoutChain) Navigates the given UI to the given location.
resolveNavigationTarget
(Location location) Resolve the navigation target for given
Location
using the router routeResolver.resolveNavigationTarget
(String pathInfo, Map<String, String[]> parameterMap) Resolve the navigation target for given path and parameter map using the router routeResolver.
Resolve a navigation target with an empty
NotFoundException
.
-
Constructor Details
-
Router
Constructs a new router with the given route registry and a
DefaultRouteResolver
.Parameters:
registry
- the route registry to use, notnull
-
-
Method Details
-
initializeUI
Enables navigation for a new UI instance. This initializes the UI content based on the location used for loading the UI and sets up the UI to be updated when the user navigates to some other location.
Parameters:
ui
- the UI that navigation should be set up forlocation
- the location object of the route -
getRegistry
-