@ApplicationScoped public class DefaultRouter extends Object implements Router
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultRouter()
Deprecated.
CDI eyes only
|
|
DefaultRouter(Proxifier proxifier,
TypeFinder finder,
Converters converters,
ParameterNameProvider nameProvider,
Evaluator evaluator,
EncodingHandler encodingHandler,
CacheStore<Invocation,Route> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Route r)
You can override this method to get notified by all added routes.
|
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.
|
protected DefaultRouter()
@Inject public DefaultRouter(Proxifier proxifier, TypeFinder finder, Converters converters, ParameterNameProvider nameProvider, Evaluator evaluator, EncodingHandler encodingHandler, CacheStore<Invocation,Route> cache)
public RouteBuilder builderFor(String uri)
builderFor in interface Routerpublic void add(Route r)
public ControllerMethod parse(String uri, HttpMethod method, MutableRequest request) throws MethodNotAllowedException
RouterControllerMethod that can handle this request.parse in interface RouterMethodNotAllowedException - when there is no ControllerMethod that can handle
given URI with given HttpMethodpublic EnumSet<HttpMethod> allowedMethodsFor(String uri)
allowedMethodsFor in interface Routerpublic <T> String urlFor(Class<T> type, Method method, Object... params)
RouterCopyright © 2014 Caelum. All rights reserved.