public class RouteUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static Pattern |
PATH_VARIABLE_PATTERN |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
hasPathVariables(String routePath)
是否有 pathVariable
|
static List<String> |
pathVariableNames(String routePath)
返回路由中的变量名
|
static String |
toRoutePathPattern(String routePath)
将路由路径转化为能够匹配此路径请求的正则表达式
|
static MethodType |
valueOfMethod(String method)
根据 http method 返回对应的枚举
如果没有匹配的返回 MethodType.NONE
|
public static final Pattern PATH_VARIABLE_PATTERN
public static boolean hasPathVariables(String routePath)
routePath - public static String toRoutePathPattern(String routePath)
routePath - public static List<String> pathVariableNames(String routePath)
routePath - public static MethodType valueOfMethod(String method)
method - Copyright © 2013 bastengao. All Rights Reserved.