Getting Registered Routes

To retrieve all registered Routes in the application, you can use:

Router router = UI.getCurrent().getRouter();
List<RouteData> routes = router.getRoutes();

The RouteData object contains all relevant information about the defined route, such as URL, parameters and parent layout.

Getting Registered Routes By Parent Layout

To get all the routes defined by parent layout, you can use instead:

Router router = UI.getCurrent().getRouter();
Map<Class<? extends RouterLayout>, List<RouteData>> routesByParent = router.getRoutesByParent();
List<RouteData> myRoutes = routesByParent.get(MyParentLayout.class);

See also: