public class ConfigureRoutes extends ConfiguredRoutes implements Serializable
ConfiguredRoutes read only value object.
ConfigureRoutes is always mutable where as ConfiguredRoutes
is always
immutable.
| Constructor and Description |
|---|
ConfigureRoutes()
Create an immutable RouteConfiguration.
|
ConfigureRoutes(ConfiguredRoutes original)
Create a mutable or immutable configuration with original configuration
information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all maps from this configuration.
|
Map<Class<? extends Exception>,Class<? extends Component>> |
getExceptionHandlers()
Override so that the getters use the correct exception targets map for
data.
|
protected Map<String,RouteTarget> |
getRoutesMap()
Override so that the getters use the correct routes map for data.
|
Map<Class<? extends Component>,String> |
getTargetRoutes()
Override so that the getters use the correct target routes map for data.
|
void |
removeRoute(Class<? extends Component> targetRoute)
Remove the targetRoute completely from the configuration.
|
void |
removeRoute(String path)
Remove route for given path.
|
void |
removeRoute(String path,
Class<? extends Component> targetRoute)
Remove specific navigation target for given route.
|
void |
setErrorRoute(Class<? extends Exception> exception,
Class<? extends Component> errorTarget)
Set a error route to the configuration.
|
void |
setRoute(String path,
Class<? extends Component> navigationTarget)
Set a new
RouteTarget for the given path. |
void |
setTargetRoute(Class<? extends Component> navigationTarget,
String path)
Put a new target route for Class-to-path mapping.
|
getExceptionHandlerByClass, getParentLayouts, getRoute, getRoutePaths, getRoutes, getRouteTarget, getTargetRoute, hasRoute, hasRoute, hasRouteTargetpublic ConfigureRoutes()
public ConfigureRoutes(ConfiguredRoutes original)
original - original configuration to get data fromprotected Map<String,RouteTarget> getRoutesMap()
getRoutesMap in class ConfiguredRoutespublic Map<Class<? extends Component>,String> getTargetRoutes()
getTargetRoutes in class ConfiguredRoutespublic Map<Class<? extends Exception>,Class<? extends Component>> getExceptionHandlers()
getExceptionHandlers in class ConfiguredRoutespublic void clear()
public void setRoute(String path, Class<? extends Component> navigationTarget)
RouteTarget for the given path.
Note! this will override any previous value.
path - path for which to set route target fornavigationTarget - navigation target to addpublic void setTargetRoute(Class<? extends Component> navigationTarget, String path)
This is a reverse mapping to RouteTarget, which also handles any HasUrl parameters, for the main route of this navigation target.
navigationTarget - navigation target to mappath - path for given navigation targetpublic void setErrorRoute(Class<? extends Exception> exception, Class<? extends Component> errorTarget)
Any exception handler set for a existing error will override the old exception handler.
exception - exception handled by error routeerrorTarget - error navigation targetpublic void removeRoute(Class<? extends Component> targetRoute)
targetRoute - target registered route to removepublic void removeRoute(String path)
In case there exists another path mapping for any of the removed route targets the main class-to-string mapping will be updated to the first found.
path - path from which to remove routes frompublic void removeRoute(String path, Class<? extends Component> targetRoute)
In case there exists another path mapping for the removed route target the main class-to-string mapping will be updated to the first found.
path - path to remove target fromtargetRoute - target route to remove from pathCopyright © 2000–2019 Vaadin Ltd. All rights reserved.