public class ConfigureRoutes extends ConfiguredRoutes implements Serializable
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.
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> target)
Remove the target completely from the configuration.
|
void |
removeRoute(String template)
Remove route for given template.
|
void |
removeRoute(String template,
Class<? extends Component> targetRoute)
Remove navigation target for given template.
|
void |
setErrorRoute(Class<? extends Exception> exception,
Class<? extends Component> errorTarget)
Set a error route to the configuration.
|
void |
setRoute(String template,
Class<? extends Component> navigationTarget)
Set a new
RouteTarget for the given template. |
void |
setRoute(String template,
Class<? extends Component> navigationTarget,
List<Class<? extends RouterLayout>> parentChain)
Set a new
RouteTarget for the given template. |
void |
setTargetRoute(Class<? extends Component> navigationTarget,
String path)
Put a new target route for Class-to-path mapping.
|
copyTargetRouteModels, getExceptionHandlerByClass, getNavigationRouteTarget, getParameters, getParentLayouts, getRoute, getRoutePaths, getRoutes, getRouteTarget, getRouteTarget, getTarget, getTargetRoute, getTargetUrl, getTargetUrl, getTemplate, getTemplate, hasRoute, hasRoute, hasRouteTarget, hasTemplate
public ConfigureRoutes()
public ConfigureRoutes(ConfiguredRoutes original)
original
- original configuration to get data fromprotected Map<String,RouteTarget> getRoutesMap()
getRoutesMap
in class ConfiguredRoutes
public Map<Class<? extends Component>,String> getTargetRoutes()
getTargetRoutes
in class ConfiguredRoutes
public Map<Class<? extends Exception>,Class<? extends Component>> getExceptionHandlers()
getExceptionHandlers
in class ConfiguredRoutes
public void clear()
public void setRoute(String template, Class<? extends Component> navigationTarget)
RouteTarget
for the given template.
Note! this will override any previous value.
template
- template for which to set route target fornavigationTarget
- navigation target to addpublic void setRoute(String template, Class<? extends Component> navigationTarget, List<Class<? extends RouterLayout>> parentChain)
RouteTarget
for the given template.
Note! this will override any previous value.
template
- template for which to set route target fornavigationTarget
- navigation target to addparentChain
- chain of parent layouts that should be used with this targetpublic 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> target)
target
- target registered route to removepublic void removeRoute(String 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.
template
- template from which to remove routes fromCopyright © 2022. All rights reserved.