public class ApplicationRouteRegistry extends AbstractRouteRegistry implements ErrorRouteRegistry
Modifier and Type | Class and Description |
---|---|
protected static class |
ApplicationRouteRegistry.ApplicationRouteRegistryWrapper
RouteRegistry wrapper class for storing the ApplicationRouteRegistry.
|
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(ServletContext context)
Deprecated.
this is deprecated in favor of
getInstance(VaadinContext) and will be removed in a
future release |
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, getNavigationRouteTarget, getNavigationTarget, getNavigationTarget, getRegisteredRoutes, getRouteLayouts, getRouteTarget, getTargetUrl, getTargetUrl, getTemplate, hasLock, removeRoute, removeRoute, removeRoute, searchByCause, searchBySuperType, update
protected ApplicationRouteRegistry()
@Deprecated public static ApplicationRouteRegistry getInstance(ServletContext context)
getInstance(VaadinContext)
and will be removed in a
future releasecontext
- the vaadin context for which to get a route registry, not
null
null
public void setRoute(String path, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain)
RouteRegistry
ParentLayout
, Route
or
RouteAlias
will be ignored in route handling.setRoute
in interface RouteRegistry
setRoute
in class AbstractRouteRegistry
path
- 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)
ErrorRouteRegistry
getErrorNavigationTarget
in interface ErrorRouteRegistry
exception
- exception to search error view forpublic 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 © 2023. All rights reserved.