public interface Router
Modifier and Type | Method and Description |
---|---|
void |
add(Route route)
Add a new Route to this Router
|
java.util.EnumSet<HttpMethod> |
allowedMethodsFor(java.lang.String uri) |
java.util.List<Route> |
allRoutes()
Returns a list with all routes
|
RouteBuilder |
builderFor(java.lang.String uri) |
ResourceMethod |
parse(java.lang.String uri,
HttpMethod method,
MutableRequest request)
Find a
ResourceMethod that can handle this request. |
<T> java.lang.String |
urlFor(java.lang.Class<T> type,
java.lang.reflect.Method method,
java.lang.Object... params)
Retrieves a single url to access the desired method.
|
void add(Route route)
route
- The routeResourceMethod parse(java.lang.String uri, HttpMethod method, MutableRequest request) throws ResourceNotFoundException, MethodNotAllowedException, java.lang.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 HttpMethod
java.lang.IllegalStateException
- when more than one ResourceMethod
can handle this
request.<T> java.lang.String urlFor(java.lang.Class<T> type, java.lang.reflect.Method method, java.lang.Object... params)
java.util.List<Route> allRoutes()
RouteBuilder builderFor(java.lang.String uri)
java.util.EnumSet<HttpMethod> allowedMethodsFor(java.lang.String uri)
Copyright © 2013 Caelum. All Rights Reserved.