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, update
protected ApplicationRouteRegistry()
public static ApplicationRouteRegistry getInstance(javax.servlet.ServletContext servletContext)
servletContext
- the servlet 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)
exception
- exception to search error view forpublic 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 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 © 2019. All rights reserved.