public class AnnotationRouter extends Object implements HttpRouter
Constructor and Description |
---|
AnnotationRouter(AnnotationModule annotationModule,
Class clazz,
Method method,
Router classRouter,
Router methodRoute,
String urlPath,
String paramPath)
构造函数
|
Modifier and Type | Method and Description |
---|---|
AnnotationModule |
getAnnotationModule() |
Router |
getClassRouter() |
Class |
getClazz() |
Method |
getMethod() |
Router |
getMethodRoute() |
String |
getParamPath() |
String |
getPath() |
String |
getUrlPath() |
Object |
invokeRouterMethod(HttpRequest request,
HttpResponse response,
Class clazz,
Method method)
将一个 Http 请求映射到一个类的方法调用
|
void |
process(HttpRequest request,
HttpResponse response) |
static void |
scanRouterClassAndRegister(AnnotationModule annotationModule)
扫描包含Router注解的类
|
public AnnotationRouter(AnnotationModule annotationModule, Class clazz, Method method, Router classRouter, Router methodRoute, String urlPath, String paramPath)
annotationModule
- AnnotationModule 对象clazz
- Class对象method
- 方法对象classRouter
- 类上的 Route 注解methodRoute
- 方法上的 Route 注解urlPath
- url 路径paramPath
- 带参数的 url 路径public String getUrlPath()
public String getParamPath()
public String getPath()
public Class getClazz()
public Method getMethod()
public Router getClassRouter()
public Router getMethodRoute()
public AnnotationModule getAnnotationModule()
public static void scanRouterClassAndRegister(AnnotationModule annotationModule)
annotationModule
- AnnotationModule对象用于注册路由public Object invokeRouterMethod(HttpRequest request, HttpResponse response, Class clazz, Method method) throws Exception
request
- http 请求对象response
- http 响应对象clazz
- Class 对象method
- Method 对象Exception
- 调用过程中的异常public void process(HttpRequest request, HttpResponse response) throws Exception
process
in interface HttpRouter
Exception
Copyright © 2020 Voovan. All rights reserved.