com.bastengao.struts2.freeroute
类 RouteMapping

java.lang.Object
  继承者 com.bastengao.struts2.freeroute.RouteMapping

public class RouteMapping
extends Object

路由映射

此类为不变类(一但构造后,不会改变)

从以下版本开始:
1.0
作者:
bastengao

嵌套类摘要
static class RouteMapping.Param
          表示一个 http param 表达式
 
字段摘要
private  Class action
           
private  ActionInfo actionInfo
           
private  ContentBase contentBase
           
private  Map<CookieValue,Field> cookieValues
           
private  boolean hasPathVariables
           
private  List<MethodType> httpMethods
           
private  List<String> httpParams
           
private  Method method
           
private  List<RouteMapping.Param> params
           
private  Route route
           
private  String routePath
           
private  Pattern routePathPattern
           
private  List<String> variableNames
           
 
构造方法摘要
RouteMapping(ContentBase contentBase, Route route, Class action, Method method)
           
RouteMapping(ContentBase contentBase, Route controllerRoute, Route methodRoute, Class action, Method method)
           
RouteMapping(Route route, Class action, Method method)
           
RouteMapping(Route controllerRoute, Route methodRoute, Class action, Method method)
           
 
方法摘要
 Class getAction()
           
 ContentBase getContentBase()
           
 Map<CookieValue,Field> getCookieValues()
           
 List<MethodType> getHttpMethods()
          unmodified list
 List<String> getHttpParams()
          unmodified list
 Method getMethod()
           
 List<RouteMapping.Param> getParams()
           
 String getRoutePath()
           
 Pattern getRoutePathPattern()
           
 List<String> getVariableNames()
           
 boolean hasPathVariables()
           
private  void initActionInfo()
          缓存 actionInfo
private  void initCookieValues()
          初始化 cookie
private  void initParams()
          初始化 params
private  void initPathVariables()
          初始化 pathVariables
private  String parseRoutePath(Route controllerRoute, Route methodRoute)
           
static String prettyMethods(MethodType[] types)
          打印 @Route.method.
static String prettyParams(String[] params)
          打印 @Route.params
 String prettyPath()
           
 ActionInfo toAction()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

contentBase

private final ContentBase contentBase

route

private final Route route

routePath

private final String routePath

httpMethods

private final List<MethodType> httpMethods

httpParams

private final List<String> httpParams

params

private List<RouteMapping.Param> params

action

private final Class action

method

private final Method method

hasPathVariables

private boolean hasPathVariables

variableNames

private List<String> variableNames

routePathPattern

private Pattern routePathPattern

cookieValues

private Map<CookieValue,Field> cookieValues

actionInfo

private ActionInfo actionInfo
构造方法详细信息

RouteMapping

public RouteMapping(Route route,
                    Class action,
                    Method method)

RouteMapping

public RouteMapping(ContentBase contentBase,
                    Route route,
                    Class action,
                    Method method)

RouteMapping

public RouteMapping(Route controllerRoute,
                    Route methodRoute,
                    Class action,
                    Method method)

RouteMapping

public RouteMapping(ContentBase contentBase,
                    Route controllerRoute,
                    Route methodRoute,
                    Class action,
                    Method method)
方法详细信息

parseRoutePath

private String parseRoutePath(Route controllerRoute,
                              Route methodRoute)

initParams

private void initParams()
初始化 params


initPathVariables

private void initPathVariables()
初始化 pathVariables


initCookieValues

private void initCookieValues()
初始化 cookie


initActionInfo

private void initActionInfo()
缓存 actionInfo


toAction

public ActionInfo toAction()

getContentBase

public ContentBase getContentBase()

getRoutePath

public String getRoutePath()

getHttpParams

public List<String> getHttpParams()
unmodified list

返回:

getHttpMethods

public List<MethodType> getHttpMethods()
unmodified list

返回:

getParams

public List<RouteMapping.Param> getParams()

getAction

public Class getAction()

getMethod

public Method getMethod()

hasPathVariables

public boolean hasPathVariables()

getVariableNames

public List<String> getVariableNames()

getRoutePathPattern

public Pattern getRoutePathPattern()

getCookieValues

public Map<CookieValue,Field> getCookieValues()

prettyPath

public String prettyPath()

prettyParams

public static String prettyParams(String[] params)
打印 @Route.params

参数:
params -
返回:

prettyMethods

public static String prettyMethods(MethodType[] types)
打印 @Route.method.

参数:
types -
返回:


Copyright © 2013 bastengao. All Rights Reserved.