play.mvc
Class Router
java.lang.Object
play.mvc.Router
public class Router
- extends Object
The router matches HTTP requests to action invocations
|
Method Summary |
static void |
addRoute(String method,
String path,
String action)
This one can be called to add new route. |
protected static void |
appendRoute(String method,
String path,
String action,
String params)
This is used internally when reading the route file. |
static void |
detectChanges(String prefix)
|
static String |
getFullUrl(String action)
|
static String |
getFullUrl(String action,
Map<String,Object> args)
|
static Router.Route |
getRoute(String method,
String path,
String action,
String params)
|
static void |
load(String prefix)
|
static Router.ActionDefinition |
reverse(String action)
|
static Router.ActionDefinition |
reverse(String action,
Map<String,Object> args)
|
static String |
reverse(VirtualFile file)
|
static String |
reverseWithCheck(String name,
VirtualFile file)
|
static void |
route(Http.Request request)
|
static Map<String,String> |
route(String method,
String path)
|
static void |
routeOnlyStatic(Http.Request request)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lastLoading
public static long lastLoading
routes
public static List<Router.Route> routes
Router
public Router()
load
public static void load(String prefix)
addRoute
public static void addRoute(String method,
String path,
String action)
- This one can be called to add new route. Last added is first in the route list.
appendRoute
protected static void appendRoute(String method,
String path,
String action,
String params)
- This is used internally when reading the route file. The order the routes are added matters and
we want the to append the routes to the list.
getRoute
public static Router.Route getRoute(String method,
String path,
String action,
String params)
detectChanges
public static void detectChanges(String prefix)
routeOnlyStatic
public static void routeOnlyStatic(Http.Request request)
route
public static void route(Http.Request request)
route
public static Map<String,String> route(String method,
String path)
reverse
public static Router.ActionDefinition reverse(String action)
getFullUrl
public static String getFullUrl(String action,
Map<String,Object> args)
getFullUrl
public static String getFullUrl(String action)
reverse
public static String reverse(VirtualFile file)
reverseWithCheck
public static String reverseWithCheck(String name,
VirtualFile file)
reverse
public static Router.ActionDefinition reverse(String action,
Map<String,Object> args)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly