Package com.vaadin.flow.router.internal
Class RouteUtil
- java.lang.Object
-
- com.vaadin.flow.router.internal.RouteUtil
-
public class RouteUtil extends Object
Utility class with methods for route handling.For internal use only. May be renamed or removed in a future release.
- Since:
- 1.3
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRouteUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static List<Class<? extends RouterLayout>>getParentLayouts(VaadinContext context, Class<?> component, String path)Get parent layouts for navigation target according to theRouteorRouteAliasannotation.static List<Class<? extends RouterLayout>>getParentLayouts(Class<?> component, String path)Deprecated.static List<Class<? extends RouterLayout>>getParentLayoutsForNonRouteTarget(Class<?> navigationTarget)Collect possible route parent layouts for a navigation target that is not annotated withRoutenorRouteAlias, but may still containParentLayout.static StringgetRouteAliasPath(Class<?> component, RouteAlias alias)Get the actual route path including all parent layoutRoutePrefix.static StringgetRoutePath(VaadinContext context, Class<?> component)Get the actual route path including all parent layoutRoutePrefix.static StringgetRoutePath(Class<?> component, Route route)Deprecated.UsegetRoutePath(VaadinContext, Class)insteadstatic Class<? extends RouterLayout>getTopParentLayout(VaadinContext context, Class<?> component, String path)Get the top most parent layout for navigation target according to theRouteorRouteAliasannotation.static Class<? extends RouterLayout>getTopParentLayout(Class<?> component, String path)Deprecated.UsegetTopParentLayout(VaadinContext, Class, String)insteadstatic Stringresolve(VaadinContext context, Class<?> component)Gets the effective route path value of the annotated class.static Stringresolve(Class<?> component, Route route)Deprecated.Useresolve(VaadinContext, Class)orRoutePathProviderdirectly insteadstatic voidupdateRouteRegistry(RouteRegistry registry, Set<Class<?>> addedClasses, Set<Class<?>> modifiedClasses, Set<Class<?>> deletedClasses)Updates route registry as necessary when classes have been added / modified / deleted.
-
-
-
Method Detail
-
getParentLayouts
@Deprecated public static List<Class<? extends RouterLayout>> getParentLayouts(Class<?> component, String path)
Deprecated.Get parent layouts for navigation target according to theRouteorRouteAliasannotation.- Parameters:
component- navigation target to get parents forpath- path used to get navigation target so we know which annotation to handle- Returns:
- parent layouts for target
-
getParentLayouts
public static List<Class<? extends RouterLayout>> getParentLayouts(VaadinContext context, Class<?> component, String path)
Get parent layouts for navigation target according to theRouteorRouteAliasannotation.- Parameters:
context- a Vaadin contextcomponent- navigation target to get parents forpath- path used to get navigation target so we know which annotation to handle- Returns:
- parent layouts for target
-
getRoutePath
@Deprecated public static String getRoutePath(Class<?> component, Route route)
Deprecated.UsegetRoutePath(VaadinContext, Class)insteadGet the actual route path including all parent layoutRoutePrefix.- Parameters:
component- navigation target component to get route path forroute- route annotation to check- Returns:
- actual path for given route target
-
getRoutePath
public static String getRoutePath(VaadinContext context, Class<?> component)
Get the actual route path including all parent layoutRoutePrefix.- Parameters:
context- a Vaadin contextcomponent- navigation target component to get route path for- Returns:
- actual path for given route target
-
getRouteAliasPath
public static String getRouteAliasPath(Class<?> component, RouteAlias alias)
Get the actual route path including all parent layoutRoutePrefix.- Parameters:
component- navigation target component to get route path foralias- route alias annotation to check- Returns:
- actual path for given route alias target
-
getParentLayoutsForNonRouteTarget
public static List<Class<? extends RouterLayout>> getParentLayoutsForNonRouteTarget(Class<?> navigationTarget)
Collect possible route parent layouts for a navigation target that is not annotated withRoutenorRouteAlias, but may still containParentLayout. Mainly error navigation targets.- Parameters:
navigationTarget- route to check parent layouts for- Returns:
- list of parent layouts
-
getTopParentLayout
@Deprecated public static Class<? extends RouterLayout> getTopParentLayout(Class<?> component, String path)
Deprecated.UsegetTopParentLayout(VaadinContext, Class, String)insteadGet the top most parent layout for navigation target according to theRouteorRouteAliasannotation. Also handles non route targets withParentLayout.- Parameters:
component- navigation target to get top most parent forpath- path used to get navigation target so we know which annotation to handle or null for error views.- Returns:
- top parent layout for target or null if none found
-
getTopParentLayout
public static Class<? extends RouterLayout> getTopParentLayout(VaadinContext context, Class<?> component, String path)
Get the top most parent layout for navigation target according to theRouteorRouteAliasannotation. Also handles non route targets withParentLayout.- Parameters:
component- navigation target to get top most parent forpath- path used to get navigation target so we know which annotation to handle or null for error views.- Returns:
- top parent layout for target or null if none found
-
resolve
@Deprecated public static String resolve(Class<?> component, Route route)
Deprecated.Useresolve(VaadinContext, Class)orRoutePathProviderdirectly insteadGets the effective route path value of the annotated class.- Parameters:
component- the component where the route points toroute- the annotation- Returns:
- The value of the annotation or naming convention based value if no explicit value is given.
-
resolve
public static String resolve(VaadinContext context, Class<?> component)
Gets the effective route path value of the annotated class.- Parameters:
context- a Vaadin contexxtcomponent- the component where the route points to- Returns:
- The value of the annotation or naming convention based value if no explicit value is given.
-
updateRouteRegistry
public static void updateRouteRegistry(RouteRegistry registry, Set<Class<?>> addedClasses, Set<Class<?>> modifiedClasses, Set<Class<?>> deletedClasses)
Updates route registry as necessary when classes have been added / modified / deleted.- Parameters:
registry- route registryaddedClasses- added classesmodifiedClasses- modified classesdeletedClasses- deleted classes
-
-