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) |
ResourceMethod |
parse(String uri,
HttpMethod method,
MutableRequest request)
Find a
ResourceMethod 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 routeResourceMethod parse(String uri, HttpMethod method, MutableRequest request) throws ResourceNotFoundException, MethodNotAllowedException, IllegalStateException
ResourceMethod that can handle this request.ResourceNotFoundException - when there is no ResourceMethod that can handle
this requestMethodNotAllowedException - when there is no ResourceMethod that can handle
given URI with given HttpMethodIllegalStateException - when more than one ResourceMethod 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.