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.
|
Optional<Class<? extends Component>> |
getNavigationTarget(String pathString)
Gets the optional navigation target class for a given path.
|
Optional<Class<? extends Component>> |
getNavigationTarget(String pathString,
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)
Get the layout chain for given navigation target on the targeted path.
|
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.
|
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 Optional<Class<? extends Component>> getNavigationTarget(String pathString)
RouteRegistryNote! If a path has been specifically removed from a registry it will not be served from possible higher lever registries either.
pathString - the path to get the navigation target for, not nullpublic Optional<Class<? extends Component>> getNavigationTarget(String pathString, List<String> segments)
RouteRegistryNote! If a path has been specifically removed from a registry it will not be served from possible higher lever registries either.
pathString - path to get navigation target for, not nullsegments - segments given for pathLocationpublic Optional<String> getTargetUrl(Class<? extends Component> navigationTarget)
RouteRegistryWill return Optional.empty is navigation target was not found.
getTargetUrl in interface RouteRegistrygetTargetUrl in class AbstractRouteRegistrynavigationTarget - navigation target to get registered route for, not
nullpublic List<Class<? extends RouterLayout>> getRouteLayouts(String path, Class<? extends Component> navigationTarget)
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 forCopyright © 2000–2019 Vaadin Ltd. All rights reserved.