public class RouteTarget extends Object implements Serializable
Constructor and Description |
---|
RouteTarget(Class<? extends Component> target)
Create a new Route target holder with the given target registered.
|
RouteTarget(Class<? extends Component> target,
boolean mutable)
Create a new Route target holder with the given target registered.
|
Modifier and Type | Method and Description |
---|---|
void |
addRoute(Class<? extends Component> target)
Add a new route navigation target.
|
boolean |
containsTarget(Class<? extends Component> target)
Check if navigation target is present in current target.
|
RouteTarget |
copy(boolean mutable)
Create a copy of this RouteTarget.
|
List<Class<? extends RouterLayout>> |
getParentLayouts(Class<? extends Component> target)
Get the parent layout chain defined for the given target.
|
List<Class<? extends Component>> |
getRoutes()
Get all registered targets for this routeTarget as a iterable.
|
Class<? extends Component> |
getTarget(List<String> segments)
Get route target for given segments.
|
boolean |
isEmpty()
Check if this RouteTarget is empty.
|
void |
remove(Class<? extends Component> targetRoute)
Remove target route from this RouteTarget.
|
void |
setParentLayouts(Class<? extends Component> target,
List<Class<? extends RouterLayout>> parents)
Set the parent layout chain for target component.
|
public RouteTarget(Class<? extends Component> target)
Note! This will create a mutable RouteTarget by default.
target
- navigation targetInvalidRouteConfigurationException
- exception for miss configured routes where navigation targets
can not be clearly selectedpublic RouteTarget(Class<? extends Component> target, boolean mutable)
target
- navigation targetmutable
- if this should be mutableInvalidRouteConfigurationException
- exception for miss configured routes where navigation targets
can not be clearly selectedpublic void addRoute(Class<? extends Component> target)
When adding a new target it will be validated that it is a valid path to add with the already existing navigation targets.
target
- navigation target to addInvalidRouteConfigurationException
- exception for miss configured routes where navigation targets
can not be clearly selectedpublic Class<? extends Component> getTarget(List<String> segments)
segments
- route segmentspublic RouteTarget copy(boolean mutable)
mutable
- if created copy is mutable or notpublic void remove(Class<? extends Component> targetRoute)
targetRoute
- route to removepublic boolean containsTarget(Class<? extends Component> target)
target
- navigation target to check forpublic boolean isEmpty()
public List<Class<? extends Component>> getRoutes()
public void setParentLayouts(Class<? extends Component> target, List<Class<? extends RouterLayout>> parents)
Note! if adding parents for a non registered target an IllegalArgumentException will be thrown.
target
- target to add chain forparents
- parent layout chainpublic List<Class<? extends RouterLayout>> getParentLayouts(Class<? extends Component> target)
target
- target to get parent layout chain forCopyright © 2020. All rights reserved.