public class ConfiguredRoutes extends Object implements Serializable
Note! This is always immutable and any changes should be made from ConfigureRoutes
.
Constructor and Description |
---|
ConfiguredRoutes()
Create an immutable RouteConfiguration.
|
ConfiguredRoutes(ConfigureRoutes original)
Create a mutable or immutable configuration with original configuration
information.
|
Modifier and Type | Method and Description |
---|---|
Class<? extends Component> |
getExceptionHandlerByClass(Class<?> exceptionClass)
Get a exception handler by exception class.
|
Map<Class<? extends Exception>,Class<? extends Component>> |
getExceptionHandlers()
Get all registered exception handlers as a exception-to-handler map.
|
List<Class<? extends RouterLayout>> |
getParentLayouts(String path,
Class<? extends Component> navigationTarget)
Return the parent layout chain for given navigation target on the target
path.
|
Optional<Class<? extends Component>> |
getRoute(String pathString,
List<String> segments)
Get the route class matching the given path and path segments.
|
protected List<String> |
getRoutePaths(Class<? extends Component> routeTarget)
Collect all routes for which given routeTarget is registered.
|
Set<String> |
getRoutes()
Get all registered paths that have been registered.
|
protected Map<String,RouteTarget> |
getRoutesMap() |
protected RouteTarget |
getRouteTarget(String path)
Get the RouteTarget stored for the given path.
|
String |
getTargetRoute(Class<? extends Component> navigationTarget)
Get the route path String for the given navigation target class.
|
Map<Class<? extends Component>,String> |
getTargetRoutes()
Get all registered target routes for this configuration.
|
boolean |
hasRoute(String path)
See if configuration contains a registered route for given path.
|
boolean |
hasRoute(String pathString,
List<String> segments)
Check if configuration holds a route for given path with possible path
segments.
|
boolean |
hasRouteTarget(Class<? extends Component> targetRoute)
Check it the given route target has been registered to the configuration.
|
public ConfiguredRoutes()
public ConfiguredRoutes(ConfigureRoutes original)
original
- original configuration to get data fromprotected Map<String,RouteTarget> getRoutesMap()
protected List<String> getRoutePaths(Class<? extends Component> routeTarget)
routeTarget
- route target to collect registered paths forpublic boolean hasRoute(String path)
path
- path to checkpublic boolean hasRoute(String pathString, List<String> segments)
pathString
- path string to checksegments
- path segments for routepublic boolean hasRouteTarget(Class<? extends Component> targetRoute)
targetRoute
- target to check registration status forpublic Optional<Class<? extends Component>> getRoute(String pathString, List<String> segments)
pathString
- string to get the route forsegments
- possible path segmentsOptional
containing the navigationTarget class if foundpublic Set<String> getRoutes()
public Map<Class<? extends Component>,String> getTargetRoutes()
public String getTargetRoute(Class<? extends Component> navigationTarget)
navigationTarget
- navigationTarget to get registered route forpublic Class<? extends Component> getExceptionHandlerByClass(Class<?> exceptionClass)
exceptionClass
- exception class to get exception handler forpublic Map<Class<? extends Exception>,Class<? extends Component>> getExceptionHandlers()
public List<Class<? extends RouterLayout>> getParentLayouts(String path, Class<? extends Component> navigationTarget)
path
- path to get parent layout chain fornavigationTarget
- navigation target on path to get parent layout chain forprotected RouteTarget getRouteTarget(String path)
path
- path to get route target fornull
if nothing registeredCopyright © 2020. All rights reserved.