public abstract class Routes extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Routes.Route |
Constructor and Description |
---|
Routes() |
Modifier and Type | Method and Description |
---|---|
Routes |
add(Routes routes)
Add Routes
|
Routes |
add(String controllerKey,
Class<? extends Controller> controllerClass)
Add route.
|
Routes |
add(String controllerKey,
Class<? extends Controller> controllerClass,
String viewPath)
Add route
|
Routes |
addInterceptor(Interceptor interceptor)
Add inject interceptor for controller in this Routes
|
void |
clear() |
abstract void |
config()
Implement this method to add route, add interceptor and set baseViewPath
|
String |
getBaseViewPath() |
Interceptor[] |
getInterceptors() |
List<Routes.Route> |
getRouteItemList() |
static List<Routes> |
getRoutesList() |
Routes |
setBaseViewPath(String baseViewPath)
Set base view path for controller in this routes
|
void |
setClearAfterMapping(boolean clearAfterMapping)
配置是否在路由映射完成之后清除内部数据,以回收内存,默认值为 true.
|
public abstract void config()
public Routes add(String controllerKey, Class<? extends Controller> controllerClass, String viewPath)
controllerKey
- A key can find controllercontrollerClass
- Controller ClassviewPath
- View path for this Controllerpublic Routes add(String controllerKey, Class<? extends Controller> controllerClass)
controllerKey
- A key can find controllercontrollerClass
- Controller Classpublic Routes addInterceptor(Interceptor interceptor)
public Routes setBaseViewPath(String baseViewPath)
public String getBaseViewPath()
public List<Routes.Route> getRouteItemList()
public Interceptor[] getInterceptors()
public void setClearAfterMapping(boolean clearAfterMapping)
public void clear()
Copyright © 2018. All rights reserved.