public class ApplicationRouteRegistry extends AbstractRouteRegistry
AbstractRouteRegistry.Configuration| Modifier | Constructor and Description |
|---|---|
protected |
ApplicationRouteRegistry()
Creates a new uninitialized route registry.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<ErrorTargetEntry> |
getErrorNavigationTarget(Exception exception)
Get a registered navigation target for given exception.
|
static ApplicationRouteRegistry |
getInstance(javax.servlet.ServletContext servletContext)
Gets the route registry for the given servlet context.
|
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.
|
Class<?> |
getPwaConfigurationClass()
Gets pwa configuration class.
|
protected void |
handleInitializedRegistry()
Handles an attempt to initialize already initialized route registry.
|
boolean |
hasNavigationTargets()
Check if there are registered navigation targets in the registry.
|
void |
setErrorNavigationTargets(Set<Class<? extends Component>> errorNavigationTargets)
Set error handler navigation targets.
|
void |
setPwaConfigurationClass(Class<?> pwaClass)
Sets pwa configuration class.
|
void |
setRoute(String path,
Class<? extends Component> navigationTarget,
List<Class<? extends RouterLayout>> parentChain)
Register a navigation target with specified path and given parent layout
chain.
|
addErrorTarget, addRoutesChangeListener, clean, configure, fireEvent, getConfiguration, getRegisteredRoutes, getRouteLayouts, getTargetUrl, hasLock, removeRoute, removeRoute, removeRoute, searchByCause, searchBySuperType, updateprotected ApplicationRouteRegistry()
public static ApplicationRouteRegistry getInstance(javax.servlet.ServletContext servletContext)
servletContext - the servlet context for which to get a route registry, not
nullnullpublic void setRoute(String path, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain)
RouteRegistryParentLayout, Route or RouteAlias will
be ignored in route handling.setRoute in interface RouteRegistrysetRoute in class AbstractRouteRegistrypath - path to register navigation target tonavigationTarget - navigation target to register into session scopeparentChain - chain of parent layouts that should be used with this targetpublic void setErrorNavigationTargets(Set<Class<? extends Component>> errorNavigationTargets)
This can also be used to add error navigation targets that override existing targets. Note! The overriding targets need to be extending the existing target or they will throw.
errorNavigationTargets - error handler navigation targetspublic Optional<ErrorTargetEntry> getErrorNavigationTarget(Exception exception)
exception - exception to search error view forpublic 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 boolean hasNavigationTargets()
public Class<?> getPwaConfigurationClass()
public void setPwaConfigurationClass(Class<?> pwaClass)
AbstractRouteRegistryInitializer.pwaClass - a class that has PWA -annotation, that's to be used in service
initialization.protected void handleInitializedRegistry()
Copyright © 2000–2019 Vaadin Ltd. All rights reserved.