Search in sources :

Example 1 with VertxRoute

use of justlive.earth.breeze.snow.common.web.vertx.annotation.VertxRoute in project earth-snow by justlive1.

the class RouteRegisterFactory method parseVertxRoute.

/**
 * 解析{@code VertxRoute}注解的route类
 *
 * @param clazz
 */
private void parseVertxRoute(Class<?> clazz) {
    VertxRoute route = clazz.getAnnotation(VertxRoute.class);
    Object bean;
    try {
        bean = clazz.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
        throw Exceptions.wrap(e);
    }
    String root = transferUri(route.value());
    Method[] methods = clazz.getMethods();
    for (Method method : methods) {
        if (method.isAnnotationPresent(VertxRouteMapping.class)) {
            parseVertxRouteMapping(root, method, bean);
        }
    }
}
Also used : VertxRoute(justlive.earth.breeze.snow.common.web.vertx.annotation.VertxRoute) HttpMethod(io.vertx.core.http.HttpMethod) Method(java.lang.reflect.Method)

Aggregations

HttpMethod (io.vertx.core.http.HttpMethod)1 Method (java.lang.reflect.Method)1 VertxRoute (justlive.earth.breeze.snow.common.web.vertx.annotation.VertxRoute)1