|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.mvc.Router
public class Router
The router matches HTTP requests to action invocations
Nested Class Summary | |
---|---|
static class |
Router.ActionDefinition
|
static class |
Router.Route
|
Field Summary | |
---|---|
static long |
lastLoading
Timestamp the routes file was last loaded at. |
static java.util.List<Router.Route> |
routes
All the loaded routes. |
Constructor Summary | |
---|---|
Router()
|
Method Summary | |
---|---|
static void |
addRoute(int position,
java.lang.String method,
java.lang.String path,
java.lang.String headers)
Add a route at the given position |
static void |
addRoute(int position,
java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String headers)
Add a route at the given position |
static void |
addRoute(int position,
java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers)
Add a route at the given position |
static void |
addRoute(java.lang.String method,
java.lang.String path,
java.lang.String action)
Add a new route. |
static void |
addRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String headers)
Add a route at the given position |
static void |
addRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers)
Add a route |
static void |
appendRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers,
java.lang.String sourceFile,
int line)
This is used internally when reading the route file. |
static void |
detectChanges(java.lang.String prefix)
In PROD mode and if the routes are already loaded, this does nothing. |
static java.lang.String |
getFullUrl(java.lang.String action)
|
static java.lang.String |
getFullUrl(java.lang.String action,
java.util.Map<java.lang.String,java.lang.Object> args)
|
static Router.Route |
getRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers)
|
static Router.Route |
getRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers,
java.lang.String sourceFile,
int line)
|
static void |
load(java.lang.String prefix)
Parse the routes file. |
static void |
prependRoute(java.lang.String method,
java.lang.String path,
java.lang.String action)
This one can be called to add new route. |
static void |
prependRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String headers)
This one can be called to add new route. |
static void |
prependRoute(java.lang.String method,
java.lang.String path,
java.lang.String action,
java.lang.String params,
java.lang.String headers)
Add a new route at the beginning of the route list |
static Router.ActionDefinition |
reverse(java.lang.String action)
|
static Router.ActionDefinition |
reverse(java.lang.String action,
java.util.Map<java.lang.String,java.lang.Object> args)
|
static java.lang.String |
reverse(VirtualFile file)
|
static java.lang.String |
reverse(VirtualFile file,
boolean absolute)
|
static java.lang.String |
reverseWithCheck(java.lang.String name,
VirtualFile file,
boolean absolute)
|
static Router.Route |
route(Http.Request request)
|
static java.util.Map<java.lang.String,java.lang.String> |
route(java.lang.String method,
java.lang.String path)
|
static java.util.Map<java.lang.String,java.lang.String> |
route(java.lang.String method,
java.lang.String path,
java.lang.String headers)
|
static java.util.Map<java.lang.String,java.lang.String> |
route(java.lang.String method,
java.lang.String path,
java.lang.String headers,
java.lang.String host)
|
static void |
routeOnlyStatic(Http.Request request)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static long lastLoading
public static java.util.List<Router.Route> routes
Constructor Detail |
---|
public Router()
Method Detail |
---|
public static void load(java.lang.String prefix)
prefix
- The prefix that the path of all routes in this route file start with. This prefix should not end with a '/' character.public static void prependRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String headers)
public static void prependRoute(java.lang.String method, java.lang.String path, java.lang.String action)
public static void addRoute(int position, java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers)
public static void addRoute(int position, java.lang.String method, java.lang.String path, java.lang.String headers)
public static void addRoute(int position, java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String headers)
public static void addRoute(java.lang.String method, java.lang.String path, java.lang.String action)
public static void addRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String headers)
public static void addRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers)
public static void appendRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers, java.lang.String sourceFile, int line)
public static Router.Route getRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers)
public static Router.Route getRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers, java.lang.String sourceFile, int line)
public static void prependRoute(java.lang.String method, java.lang.String path, java.lang.String action, java.lang.String params, java.lang.String headers)
public static void detectChanges(java.lang.String prefix)
In DEV mode, this checks each routes file's "last modified" time to see if the routes need updated.
prefix
- The prefix that the path of all routes in this route file start with. This prefix should not end with a '/' character.public static void routeOnlyStatic(Http.Request request)
public static Router.Route route(Http.Request request)
public static java.util.Map<java.lang.String,java.lang.String> route(java.lang.String method, java.lang.String path)
public static java.util.Map<java.lang.String,java.lang.String> route(java.lang.String method, java.lang.String path, java.lang.String headers)
public static java.util.Map<java.lang.String,java.lang.String> route(java.lang.String method, java.lang.String path, java.lang.String headers, java.lang.String host)
public static Router.ActionDefinition reverse(java.lang.String action)
public static java.lang.String getFullUrl(java.lang.String action, java.util.Map<java.lang.String,java.lang.Object> args)
public static java.lang.String getFullUrl(java.lang.String action)
public static java.lang.String reverse(VirtualFile file)
public static java.lang.String reverse(VirtualFile file, boolean absolute)
public static java.lang.String reverseWithCheck(java.lang.String name, VirtualFile file, boolean absolute)
public static Router.ActionDefinition reverse(java.lang.String action, java.util.Map<java.lang.String,java.lang.Object> args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |