public class SessionRouteRegistry extends AbstractRouteRegistry
AbstractRouteRegistry.Configuration| Modifier and Type | Method and Description |
|---|---|
Registration |
addRoutesChangeListener(RoutesChangedListener listener)
Adds the given route change listener to the registry.
|
NavigationRouteTarget |
getNavigationRouteTarget(String url)
Search for a route target using given navigation
url
argument. |
Optional<Class<? extends Component>> |
getNavigationTarget(String url)
Gets the optional navigation target class for a given path.
|
Optional<Class<? extends Component>> |
getNavigationTarget(String url,
List<String> segments)
Gets the optional navigation target class for a given Location matching
with path segments.
|
List<RouteData> |
getRegisteredRoutes()
Get the
RouteData for all registered navigation targets. |
List<Class<? extends RouterLayout>> |
getRouteLayouts(String path,
Class<? extends Component> navigationTarget)
Deprecated.
instead use
getNavigationRouteTarget(String) and
retrieve the list of route layouts from the
RouteTarget contained in the
NavigationRouteTarget. |
RouteTarget |
getRouteTarget(Class<? extends Component> target,
RouteParameters parameters)
Gets the
RouteTarget instance matching the given target component
and route parameters. |
static RouteRegistry |
getSessionRegistry(VaadinSession session)
Get the session registry for VaadinSession.
|
Optional<String> |
getTargetUrl(Class<? extends Component> navigationTarget)
Get the url string for given navigation target.
|
Optional<String> |
getTargetUrl(Class<? extends Component> navigationTarget,
RouteParameters parameters)
Get the url string for given navigation target.
|
Optional<String> |
getTemplate(Class<? extends Component> navigationTarget)
Get the main template for given navigation target.
|
addErrorTarget, clean, configure, fireEvent, getConfiguration, hasLock, removeRoute, removeRoute, removeRoute, searchByCause, searchBySuperType, setRoute, updatepublic static RouteRegistry getSessionRegistry(VaadinSession session)
session - vaadin session to get registry forpublic List<RouteData> getRegisteredRoutes()
RouteRegistryRouteData for all registered navigation targets.getRegisteredRoutes in interface RouteRegistrygetRegisteredRoutes in class AbstractRouteRegistrypublic Registration addRoutesChangeListener(RoutesChangedListener listener)
For the session scoped registry also changes to the application scoped registry will be delegated to the listener if the added or removed route was not masked by a registration in the session scope.
addRoutesChangeListener in interface RouteRegistryaddRoutesChangeListener in class AbstractRouteRegistrylistener - listener to addpublic NavigationRouteTarget getNavigationRouteTarget(String url)
RouteRegistryurl
argument.getNavigationRouteTarget in interface RouteRegistrygetNavigationRouteTarget in class AbstractRouteRegistryurl - the navigation url used to search a route target.NavigationRouteTarget instance containing the
RouteTarget and RouteParameters extracted from
the url argument according with the route
configuration.public RouteTarget getRouteTarget(Class<? extends Component> target, RouteParameters parameters)
RouteRegistryRouteTarget instance matching the given target component
and route parameters.getRouteTarget in interface RouteRegistrygetRouteTarget in class AbstractRouteRegistrytarget - a component class which is a navigation target.parameters - parameter values that may be used with given target.RouteTarget instance matching the given target
component and route parameters.public Optional<Class<? extends Component>> getNavigationTarget(String url)
RouteRegistrygetNavigationTarget in interface RouteRegistrygetNavigationTarget in class AbstractRouteRegistryurl - the path to get the navigation target for, not nullpublic Optional<Class<? extends Component>> getNavigationTarget(String url, List<String> segments)
RouteRegistrygetNavigationTarget in interface RouteRegistrygetNavigationTarget in class AbstractRouteRegistryurl - path to get navigation target for, not nullsegments - segments given for pathLocationpublic Optional<String> getTargetUrl(Class<? extends Component> navigationTarget)
RouteRegistrygetTargetUrl in interface RouteRegistrygetTargetUrl in class AbstractRouteRegistrynavigationTarget - navigation target to get registered route for, not
nullOptional navigation target url string or
Optional.empty() if navigation target was not foundpublic Optional<String> getTargetUrl(Class<? extends Component> navigationTarget, RouteParameters parameters)
RouteRegistrygetTargetUrl in interface RouteRegistrygetTargetUrl in class AbstractRouteRegistrynavigationTarget - navigation target to get registered route for, not
nullparameters - parameters for the target url.Optional navigation target url string or
Optional.empty() if navigation target was not foundpublic Optional<String> getTemplate(Class<? extends Component> navigationTarget)
RouteRegistry
In case of annotated target the main template is composed of the
Route annotation value prefixed by all RoutePrefix values
of the parent RouterLayouts chain.
getTemplate in interface RouteRegistrygetTemplate in class AbstractRouteRegistrynavigationTarget - navigation target to get route definition for, not
nullOptional navigation target template string or
Optional.empty() if navigation target was not found@Deprecated public List<Class<? extends RouterLayout>> getRouteLayouts(String path, Class<? extends Component> navigationTarget)
getNavigationRouteTarget(String) and
retrieve the list of route layouts from the
RouteTarget contained in the
NavigationRouteTarget.RouteRegistryThis chain may be pre-defined or generated from annotation data.
getRouteLayouts in interface RouteRegistrygetRouteLayouts in class AbstractRouteRegistrypath - path to use for resolving chainnavigationTarget - navigation target to get layout chain forRouteTarget.getParentLayouts()Copyright © 2025. All rights reserved.