|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Router
Contains a list of the available routes and handles conversion of URLs to parameter maps and vice versa.
The priority of a route is based on when it was added to the router. The first route has the highest priority and a URL path will always be matched against it first. If the first route does not match, the second will be tried, continuing until either a match is found or all the routes have been tested.
When choosing the order in which to place a list of routes, the general rule is to sort the routes from least general to most general. The simplest way of determining the generality of a route is by counting the number of capturing fragments in it.
Route,
DefaultFriendlyURLMapper| Method Summary | |
|---|---|
Route |
addRoute(java.lang.String pattern)
Generates a new route from its pattern string. |
java.lang.String |
parametersToUrl(java.util.Map<java.lang.String,java.lang.String> parameters)
Generates a URL from the parameter map using the available routes. |
boolean |
urlToParameters(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> parameters)
Parses a URL into a parameter map using the available routes. |
| Method Detail |
|---|
Route addRoute(java.lang.String pattern)
pattern - the route pattern string
java.lang.String parametersToUrl(java.util.Map<java.lang.String,java.lang.String> parameters)
parameters - the parameter map
null if an applicable route was not
found
boolean urlToParameters(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> parameters)
url - the URL to be parsedparameters - the parameter map to be populated
true if a match was found and
parameters was populated; false
otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||