Package com.vaadin.flow.router.internal
Class ConfigureRoutes
java.lang.Object
com.vaadin.flow.router.internal.ConfiguredRoutes
com.vaadin.flow.router.internal.ConfigureRoutes
- All Implemented Interfaces:
Serializable
Configuration class for editing routes. After editing the class should always
be set as a
ConfiguredRoutes read only value object.
ConfigureRoutes is always mutable where as ConfiguredRoutes
is always immutable.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.3
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an immutable RouteConfiguration.ConfigureRoutes(ConfiguredRoutes original) Create a mutable or immutable configuration with original configuration information. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all maps from this configuration.Override so that the getters use the correct exception targets map for data.protected Map<String,RouteTarget> Override so that the getters use the correct routes map for data.Override so that the getters use the correct target routes map for data.voidremoveRoute(Class<? extends Component> target) Remove the target completely from the configuration.voidremoveRoute(String template) Remove route for given template.voidremoveRoute(String template, Class<? extends Component> targetRoute) Remove navigation target for given template.voidsetErrorRoute(Class<? extends Exception> exception, Class<? extends Component> errorTarget) Set a error route to the configuration.voidSet a newRouteTargetfor the given template.voidsetRoute(String template, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain) Set a newRouteTargetfor the given template.voidsetTargetRoute(Class<? extends Component> navigationTarget, String path) Put a new target route for Class-to-path mapping.Methods inherited from class com.vaadin.flow.router.internal.ConfiguredRoutes
copyTargetRouteModels, getExceptionHandlerByClass, getNavigationRouteTarget, getParameters, getRoute, getRoutePaths, getRoutes, getRouteTarget, getRouteTarget, getTarget, getTargetRoute, getTargetUrl, getTargetUrl, getTemplate, getTemplate, hasRoute, hasRoute, hasRouteTarget, hasTemplate
-
Constructor Details
-
ConfigureRoutes
public ConfigureRoutes()Create an immutable RouteConfiguration. -
ConfigureRoutes
Create a mutable or immutable configuration with original configuration information.- Parameters:
original- original configuration to get data from
-
-
Method Details
-
getRoutesMap
Override so that the getters use the correct routes map for data.- Overrides:
getRoutesMapin classConfiguredRoutes- Returns:
- editable map of routes
-
getTargetRoutes
Override so that the getters use the correct target routes map for data.- Overrides:
getTargetRoutesin classConfiguredRoutes- Returns:
- editable map of targetRoutes
-
getExceptionHandlers
Override so that the getters use the correct exception targets map for data.- Overrides:
getExceptionHandlersin classConfiguredRoutes- Returns:
- editable map of exception targets
-
clear
public void clear()Clear all maps from this configuration. -
setRoute
Set a newRouteTargetfor the given template.Note! this will override any previous value.
- Parameters:
template- template for which to set route target fornavigationTarget- navigation target to add
-
setRoute
public void setRoute(String template, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain) Set a newRouteTargetfor the given template.Note! this will override any previous value.
- Parameters:
template- template for which to set route target fornavigationTarget- navigation target to addparentChain- chain of parent layouts that should be used with this target
-
setTargetRoute
Put a new target route for Class-to-path mapping.This is a reverse mapping to RouteTarget, which also handles any HasUrl parameters, for the main route of this navigation target.
- Parameters:
navigationTarget- navigation target to mappath- path for given navigation target
-
setErrorRoute
public void setErrorRoute(Class<? extends Exception> exception, Class<? extends Component> errorTarget) Set a error route to the configuration.Any exception handler set for a existing error will override the old exception handler.
- Parameters:
exception- exception handled by error routeerrorTarget- error navigation target
-
removeRoute
Remove the target completely from the configuration.- Parameters:
target- target registered route to remove
-
removeRoute
Remove route for given template. This will remove all targets registered for given template.In case there exists another template mapping for any of the removed route targets the main class-to-string mapping will be updated to the first found.
- Parameters:
template- template from which to remove routes from
-
removeRoute
Remove navigation target for given template.- Parameters:
template- template to remove target from.targetRoute- target route to remove from template.
-