@Override public Route transform(Route route) { Method method = route.getAttribute("__controllerMethod"); if (method == null) { // it's not a controller route; do nothing return route; } if (method.isAnnotationPresent(Named.class)) { Named named = method.getAnnotation(Named.class); String name = named.value(); log.debug("Set name '{}' for route {} '{}'", name, route.getRequestMethod(), route.getUriPattern()); route.setName(name); } return route; }
protected void processRouteInterceptors(RouteContext routeContext) { if (interceptors.isEmpty()) { return; } List<RouteMatch> chain = new ArrayList<>(); for (RouteHandler interceptor : interceptors) { // create a route for interceptor Route route = new Route(routeContext.getRequestMethod(), routeContext.getRequestUri(), interceptor); route.setName(StringUtils.format("{}<{}>", Interceptor.class.getSimpleName(), route.getRouteHandler().getClass().getSimpleName())); route.bindAll(routeContext.getRoute().getAttributes()); // add route in chain RouteMatch match = new RouteMatch(route, null); chain.add(match); } // TODO DefaultRouteContext is hardcoded RouteContext context = new DefaultRouteContext(routeContext.getApplication(), routeContext.getRequest(), routeContext.getResponse(), chain); context.next(); }
route.setName(StreamSupport.stream(nameStack.spliterator(), false) .collect(Collectors.joining("")));
@Override public Route transform(Route route) { Method method = route.getAttribute("__controllerMethod"); if (method == null) { // it's not a controller route; do nothing return route; } if (method.isAnnotationPresent(Named.class)) { Named named = method.getAnnotation(Named.class); String name = named.value(); log.debug("Set name '{}' for route {} '{}'", name, route.getRequestMethod(), route.getUriPattern()); route.setName(name); } return route; }
protected void processRouteInterceptors(Context context) { if (routeInterceptors.isEmpty()) { return; } List<RouteMatch> chain = new ArrayList<>(); for (RouteHandler<Context> interceptor : routeInterceptors) { Route route = new Route(context.getRequestMethod(), context.getRequestUri(), interceptor); route.setName(StringUtils.format("{}<{}>", RouteInterceptor.class.getSimpleName(), route.getRouteHandler().getClass().getSimpleName())); RouteMatch match = new RouteMatch(route, null); chain.add(match); } Context subContext = new Context(context, chain); subContext.next(); }
protected void processRouteInterceptors(Context context) { if (routeInterceptors.isEmpty()) { return; } List<RouteMatch> chain = new ArrayList<>(); for (RouteHandler<Context> interceptor : routeInterceptors) { Route route = new Route(context.getRequestMethod(), context.getRequestUri(), interceptor); route.setName(StringUtils.format("{}<{}>", RouteInterceptor.class.getSimpleName(), route.getRouteHandler().getClass().getSimpleName())); RouteMatch match = new RouteMatch(route, null); chain.add(match); } Context subContext = new Context(context, chain); subContext.next(); }
protected void processRouteInterceptors(RouteContext routeContext) { if (interceptors.isEmpty()) { return; } List<RouteMatch> chain = new ArrayList<>(); for (RouteHandler interceptor : interceptors) { // create a route for interceptor Route route = new Route(routeContext.getRequestMethod(), routeContext.getRequestUri(), interceptor); route.setName(StringUtils.format("{}<{}>", Interceptor.class.getSimpleName(), route.getRouteHandler().getClass().getSimpleName())); route.bindAll(routeContext.getRoute().getAttributes()); // add route in chain RouteMatch match = new RouteMatch(route, null); chain.add(match); } // TODO DefaultRouteContext is hardcoded RouteContext context = new DefaultRouteContext(routeContext.getApplication(), routeContext.getRequest(), routeContext.getResponse(), chain); context.next(); }
route.setName(routeRegistration.getName()); if (routeRegistration.isRunAsFinally()) { route.runAsFinally();
route.setName(routeRegistration.getName()); if (routeRegistration.isRunAsFinally()) { route.runAsFinally();