@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 Router
public void add(Route r)
public ControllerMethod parse(String uri, HttpMethod method, MutableRequest request) throws MethodNotAllowedException
Router
ControllerMethod
that can handle this request.parse
in interface Router
MethodNotAllowedException
- when there is no ControllerMethod
that can handle
given URI with given HttpMethod
public EnumSet<HttpMethod> allowedMethodsFor(String uri)
allowedMethodsFor
in interface Router
public <T> String urlFor(Class<T> type, Method method, Object... params)
Router
Copyright © 2014 Caelum. All rights reserved.