Package com.vaadin.flow.server.startup
Class ApplicationRouteRegistry
java.lang.Object
com.vaadin.flow.router.internal.AbstractRouteRegistry
com.vaadin.flow.server.startup.ApplicationRouteRegistry
- All Implemented Interfaces:
ErrorRouteRegistry
,RouteRegistry
,Serializable
Registry for holding navigation target components found on servlet
initialization.
- Since:
- 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
RouteRegistry wrapper class for storing the ApplicationRouteRegistry.Nested classes/interfaces inherited from class com.vaadin.flow.router.internal.AbstractRouteRegistry
AbstractRouteRegistry.Configuration
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ApplicationRouteRegistry
(VaadinContext context) Creates a new uninitialized route registry. -
Method Summary
Modifier and TypeMethodDescriptionGets the Vaadin context which the registry belongs to.getErrorNavigationTarget
(Exception exception) Get a registered navigation target for given exception.static ApplicationRouteRegistry
getInstance
(VaadinContext context) Gets the route registry for the given Vaadin context.Class<?>
Gets pwa configuration class.protected void
Handles an attempt to initialize already initialized route registry.boolean
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.Methods inherited from class com.vaadin.flow.router.internal.AbstractRouteRegistry
addErrorTarget, addRoutesChangeListener, clean, configure, fireEvent, getConfiguration, getLayout, getNavigationRouteTarget, getNavigationTarget, getNavigationTarget, getRegisteredAccessibleMenuRoutes, getRegisteredRoutes, getRouteTarget, getTargetUrl, getTargetUrl, getTemplate, hasLayout, hasLock, hasMandatoryParameter, removeRoute, removeRoute, removeRoute, searchByCause, searchBySuperType, setLayout, update
-
Constructor Details
-
ApplicationRouteRegistry
Creates a new uninitialized route registry.
-
-
Method Details
-
getInstance
Gets the route registry for the given Vaadin context. If the Vaadin context has no route registry, a new instance is created and assigned to the context.- Parameters:
context
- the vaadin context for which to get a route registry, notnull
- Returns:
- a registry instance for the given context, not
null
-
setRoute
public void setRoute(String path, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain) Description copied from interface:RouteRegistry
Register a navigation target with specified path and given parent layout chain. AnyParentLayout
,Route
orRouteAlias
will be ignored in route handling.- Specified by:
setRoute
in interfaceRouteRegistry
- Overrides:
setRoute
in classAbstractRouteRegistry
- Parameters:
path
- path to register navigation target tonavigationTarget
- navigation target to register into session scopeparentChain
- chain of parent layouts that should be used with this target
-
getPwaConfigurationClass
Gets pwa configuration class.- Returns:
- a class that has PWA-annotation.
-
setPwaConfigurationClass
Sets pwa configuration class. Should be set along with setRoutes, for scanning of proper pwa configuration class is done along route scanning. SeeAbstractRouteRegistryInitializer
.- Parameters:
pwaClass
- a class that has PWA -annotation, that's to be used in service initialization.
-
getContext
Description copied from interface:RouteRegistry
Gets the Vaadin context which the registry belongs to.- Specified by:
getContext
in interfaceRouteRegistry
- Returns:
- the Vaadin context
-
handleInitializedRegistry
protected void handleInitializedRegistry()Handles an attempt to initialize already initialized route registry.
-