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, update
public static RouteRegistry getSessionRegistry(VaadinSession session)
session
- vaadin session to get registry forpublic List<RouteData> getRegisteredRoutes()
RouteRegistry
RouteData
for all registered navigation targets.getRegisteredRoutes
in interface RouteRegistry
getRegisteredRoutes
in class AbstractRouteRegistry
public 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 RouteRegistry
addRoutesChangeListener
in class AbstractRouteRegistry
listener
- listener to addpublic Optional<Class<? extends Component>> getNavigationTarget(String pathString)
RouteRegistry
Note! 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 null
public Optional<Class<? extends Component>> getNavigationTarget(String pathString, List<String> segments)
RouteRegistry
Note! 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 null
segments
- segments given for pathLocation
public Optional<String> getTargetUrl(Class<? extends Component> navigationTarget)
RouteRegistry
Will return Optional.empty is navigation target was not found.
getTargetUrl
in interface RouteRegistry
getTargetUrl
in class AbstractRouteRegistry
navigationTarget
- navigation target to get registered route for, not
null
public List<Class<? extends RouterLayout>> getRouteLayouts(String path, Class<? extends Component> navigationTarget)
RouteRegistry
This chain may be pre-defined or generated from annotation data.
getRouteLayouts
in interface RouteRegistry
getRouteLayouts
in class AbstractRouteRegistry
path
- path to use for resolving chainnavigationTarget
- navigation target to get layout chain forCopyright © 2020. All rights reserved.