public interface Router
Modifier and Type | Method and Description |
---|---|
void |
compileRoutes()
Compile all the routes that have been registered with the router.
|
RouteBuilder |
DELETE() |
RouteBuilder |
GET() |
String |
getReverseRoute(Class<?> clazz,
String methodName)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(Class<?> clazz,
String methodName,
Map<String,Object> parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(Class<?> clazz,
String methodName,
Object... parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(Class<?> controllerClass,
String controllerMethodName,
Optional<Map<String,Object>> parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(MethodReference controllerMethodRef)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(MethodReference controllerMethodRef,
Map<String,Object> parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(MethodReference controllerMethodRef,
Object... parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
String |
getReverseRoute(MethodReference controllerMethodRef,
Optional<Map<String,Object>> parameterMap)
Deprecated.
Reverse routing in the Router is not validated and does not
URL-escape path or query parameters. Use
ninja.ReverseRouter
to build your reverse routes. |
Route |
getRouteFor(String httpMethod,
String uri)
Get the route for the given method and URI
|
Optional<Route> |
getRouteForControllerClassAndMethod(Class<?> controllerClass,
String controllerMethodName) |
List<Route> |
getRoutes()
Returns the list of compiled routes.
|
RouteBuilder |
HEAD() |
RouteBuilder |
METHOD(String method)
To match any http method.
|
RouteBuilder |
OPTIONS() |
RouteBuilder |
POST() |
RouteBuilder |
PUT() |
RouteBuilder |
WS() |
Route getRouteFor(String httpMethod, String uri)
httpMethod
- The methoduri
- The URI@Deprecated String getReverseRoute(Class<?> clazz, String methodName)
ninja.ReverseRouter
to build your reverse routes.getReverseRoute(Class, String, Map)
in that caseclazz
- The controllerClass e.g. ApplicationController.classmethodName
- the methodName of the class e.g. "index"@Deprecated String getReverseRoute(Class<?> clazz, String methodName, Map<String,Object> parameterMap)
ninja.ReverseRouter
to build your reverse routes.clazz
- The controllerClass e.g. ApplicationController.classmethodName
- the methodName of the class e.g. "index"map
- The map containing pairs with replacements for placeholders.
It's a String Object map so that it matches the map used to render a page.
to get the value "toString()" is called on the object. Make sure that works for your object
or simply use a String. If the raw uri does not contain the placeholders
they will be added as query parameters ?key=value&key2=value2 and so on@Deprecated String getReverseRoute(Class<?> clazz, String methodName, Object... parameterMap)
ninja.ReverseRouter
to build your reverse routes.clazz
- The controllerClass e.g. ApplicationController.classmethodName
- the methodName of the class e.g. "index"parameterMap
- The map containing pairs with replacements for placeholders.
Always supply key and value pairs. Key as strings, Values as objects.
To get the value "toString()" is called on the object. Make sure that works for your object
or simply use a String. If the raw uri does not contain the placeholders
they will be added as query parameters ?key=value&key2=value2 and so on@Deprecated String getReverseRoute(Class<?> controllerClass, String controllerMethodName, Optional<Map<String,Object>> parameterMap)
ninja.ReverseRouter
to build your reverse routes.clazz
- The controllerClass e.g. ApplicationController.classmethodName
- the methodName of the class e.g. "index"parameterMap
- An optinal map containing pairs with replacements for placeholders.
Always supply key and value pairs. Key as strings, Values as objects.
To get the value "toString()" is called on the object. Make sure that works for your object
or simply use a String. If the raw uri does not contain the placeholders
they will be added as query parameters ?key=value&key2=value2 and so on@Deprecated String getReverseRoute(MethodReference controllerMethodRef)
ninja.ReverseRouter
to build your reverse routes.@Deprecated String getReverseRoute(MethodReference controllerMethodRef, Map<String,Object> parameterMap)
ninja.ReverseRouter
to build your reverse routes.@Deprecated String getReverseRoute(MethodReference controllerMethodRef, Object... parameterMap)
ninja.ReverseRouter
to build your reverse routes.@Deprecated String getReverseRoute(MethodReference controllerMethodRef, Optional<Map<String,Object>> parameterMap)
ninja.ReverseRouter
to build your reverse routes.void compileRoutes()
Optional<Route> getRouteForControllerClassAndMethod(Class<?> controllerClass, String controllerMethodName)
RouteBuilder GET()
RouteBuilder POST()
RouteBuilder PUT()
RouteBuilder DELETE()
RouteBuilder OPTIONS()
RouteBuilder HEAD()
RouteBuilder WS()
RouteBuilder METHOD(String method)
method
- The http method like "GET" or "PROPFIND"Copyright © 2019 ninjaframework. All rights reserved.