@ApplicationScoped public class DefaultRouter extends java.lang.Object implements Router
| Constructor and Description |
|---|
DefaultRouter(RoutesConfiguration config,
Proxifier proxifier,
TypeFinder finder,
Converters converters,
ParameterNameProvider nameProvider,
Evaluator evaluator) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Route r)
You can override this method to get notified by all added routes.
|
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.
|
public DefaultRouter(RoutesConfiguration config, Proxifier proxifier, TypeFinder finder, Converters converters, ParameterNameProvider nameProvider, Evaluator evaluator)
public RouteBuilder builderFor(java.lang.String uri)
builderFor in interface Routerpublic void add(Route r)
public ResourceMethod parse(java.lang.String uri, HttpMethod method, MutableRequest request) throws MethodNotAllowedException
RouterResourceMethod that can handle this request.parse in interface RouterMethodNotAllowedException - when there is no ResourceMethod that can handle
given URI with given HttpMethodpublic java.util.EnumSet<HttpMethod> allowedMethodsFor(java.lang.String uri)
allowedMethodsFor in interface Routerpublic <T> java.lang.String urlFor(java.lang.Class<T> type,
java.lang.reflect.Method method,
java.lang.Object... params)
RouterCopyright © 2013 Caelum. All Rights Reserved.