public interface Router
| Modifier and Type | Method and Description |
|---|---|
void |
add(Route route)
Add a new Route to this Router
|
EnumSet<HttpMethod> |
allowedMethodsFor(String uri) |
List<Route> |
allRoutes()
Returns a list with all routes
|
RouteBuilder |
builderFor(String uri) |
ControllerMethod |
parse(String uri,
HttpMethod method,
MutableRequest request)
Find a
ControllerMethod that can handle this request. |
<T> String |
urlFor(Class<T> type,
Method method,
Object... params)
Retrieves a single url to access the desired method.
|
void add(Route route)
route - The routeControllerMethod parse(String uri, HttpMethod method, MutableRequest request) throws ControllerNotFoundException, MethodNotAllowedException, IllegalStateException
ControllerMethod that can handle this request.ControllerNotFoundException - when there is no ControllerMethod that can handle
this requestMethodNotAllowedException - when there is no ControllerMethod that can handle
given URI with given HttpMethodIllegalStateException - when more than one ControllerMethod can handle this
request.<T> String urlFor(Class<T> type, Method method, Object... params)
RouteBuilder builderFor(String uri)
EnumSet<HttpMethod> allowedMethodsFor(String uri)
Copyright © 2014 Caelum. All rights reserved.