use of io.jmix.ui.navigation.Route in project jmix by jmix-framework.
the class UiControllerMeta method extractRouteDefinition.
@Nullable
protected RouteDefinition extractRouteDefinition() {
Map<String, Object> route = getAnnotationAttributes(Route.class.getName());
if (route == null) {
route = traverseForRoute();
}
RouteDefinition routeDefinition = null;
if (route != null) {
String pathAttr = (String) route.get(Route.PATH_ATTRIBUTE);
String parentPrefixAttr = (String) route.get(Route.PARENT_PREFIX_ATTRIBUTE);
boolean rootRoute = (boolean) route.get(Route.ROOT_ATTRIBUTE);
routeDefinition = new RouteDefinition(pathAttr, parentPrefixAttr, rootRoute);
}
return routeDefinition;
}
use of io.jmix.ui.navigation.Route in project jmix by jmix-framework.
the class UiControllerMeta method traverseForRoute.
@Nullable
protected Map<String, Object> traverseForRoute(Class screenClass) {
// noinspection unchecked
Class<? extends FrameOwner> superClass = screenClass.getSuperclass();
if (Screen.class.getName().equals(superClass.getName())) {
return null;
}
Route route = superClass.getAnnotation(Route.class);
return route != null ? getControllerAnnotationAttributes(Route.class.getName(), superClass) : traverseForRoute(superClass);
}
Aggregations