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() |
java.lang.String |
getReverseRoute(java.lang.Class<?> clazz,
java.lang.String methodName)
Retrieves the reverse route for this controllerClass and method.
|
java.lang.String |
getReverseRoute(java.lang.Class<?> clazz,
java.lang.String methodName,
java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Retrieves the reverse route for this controllerClass and method.
|
java.lang.String |
getReverseRoute(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Object... parameterMap)
Retrieves the reverse route for this controllerClass and method.
|
java.lang.String |
getReverseRoute(java.lang.Class<?> controllerClass,
java.lang.String controllerMethodName,
com.google.common.base.Optional<java.util.Map<java.lang.String,java.lang.Object>> parameterMap)
Retrieves the reverse route for this controllerClass and method.
|
Route |
getRouteFor(java.lang.String httpMethod,
java.lang.String uri)
Get the route for the given method and URI
|
java.util.List<Route> |
getRoutes()
Returns the list of compiled routes.
|
RouteBuilder |
HEAD() |
RouteBuilder |
METHOD(java.lang.String method)
To match any http method.
|
RouteBuilder |
OPTIONS() |
RouteBuilder |
POST() |
RouteBuilder |
PUT() |
Route getRouteFor(java.lang.String httpMethod, java.lang.String uri)
httpMethod
- The methoduri
- The URIjava.lang.String getReverseRoute(java.lang.Class<?> clazz, java.lang.String methodName)
getReverseRoute(Class, String, Map)
in that caseclazz
- The controllerClass e.g. ApplicationController.classmethodName
- the methodName of the class e.g. "index"java.lang.String getReverseRoute(java.lang.Class<?> clazz, java.lang.String methodName, java.util.Map<java.lang.String,java.lang.Object> parameterMap)
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 onjava.lang.String getReverseRoute(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object... parameterMap)
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 onjava.lang.String getReverseRoute(java.lang.Class<?> controllerClass, java.lang.String controllerMethodName, com.google.common.base.Optional<java.util.Map<java.lang.String,java.lang.Object>> parameterMap)
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 onvoid compileRoutes()
java.util.List<Route> getRoutes()
RouteBuilder GET()
RouteBuilder POST()
RouteBuilder PUT()
RouteBuilder DELETE()
RouteBuilder OPTIONS()
RouteBuilder HEAD()
RouteBuilder METHOD(java.lang.String method)
method
- The http method like "GET" or "PROPFIND"Copyright © 2016 ninjaframework. All Rights Reserved.