private void registerMethods() {
        // register routes for all the methods
        for (Method method : methods) {

            final Class<?> controllerClass = method.getDeclaringClass();
            final Path methodPath = method.getAnnotation(Path.class);
            final Set<String> controllerPaths = controllers
                    .get(controllerClass);

            String[] paths = {"/"};
            if (methodPath != null) {
                paths = methodPath.value();
            }
            for (String controllerPath : controllerPaths) {

                for (String methodPathSpec : paths) {

                    final String httpMethod = getHttpMethod(method);
                    final String fullPath = controllerPath + methodPathSpec;
                    final String methodName = method.getName();

                    router.METHOD(httpMethod).route(fullPath)
                            .with(controllerClass, methodName);

                }

            }

        }
    }
private void registerMethods() {
        
        for (Method method : methods) {

            final Class<?> controllerClass = method.getDeclaringClass();
            final Path methodPath = method.getAnnotation(Path.class);
            final Set<String> controllerPaths = controllers
                    .get(controllerClass);

            String[] paths = {"/"};
            if (methodPath != null) {
                paths = methodPath.value();
            }
            for (String controllerPath : controllerPaths) {

                for (String methodPathSpec : paths) {

                    final String httpMethod = getHttpMethod(method);
                    final String fullPath = controllerPath + methodPathSpec;
                    final String methodName = method.getName();

                    router.METHOD(httpMethod).route(fullPath)
                            .with(controllerClass, methodName);

                }

            }

        }
    }
private void registerMethods ( ) { // register routes for all the methods for ( Method method : methods ) { final Class < ? > controllerClass = method . getDeclaringClass ( ) ; final Path methodPath = method . getAnnotation ( Path . class ) ; final Set < String > controllerPaths = controllers . get ( controllerClass ) ; String [ ] paths = { "/" } ; if ( methodPath != null ) { paths = methodPath . value ( ) ; } for ( String controllerPath : controllerPaths ) { for ( String methodPathSpec : paths ) { final String httpMethod = getHttpMethod ( method ) ; final String fullPath = controllerPath + methodPathSpec ; final String methodName = method . getName ( ) ; router . METHOD ( httpMethod ) . route ( fullPath ) . with ( controllerClass , methodName ) ; } } } }
Takes all methods and registers them at the controller using the path: Class:@Path + Method:@Path.
If no @Path Annotation is present at the method just the Class:@Path is used.
Takes all methods and registers them at the controller using the path : Class :