Package ninja
Class ReverseRouter
- java.lang.Object
- 
- ninja.ReverseRouter
 
- 
- All Implemented Interfaces:
- WithControllerMethod<ReverseRouter.Builder>
 
 public class ReverseRouter extends Object implements WithControllerMethod<ReverseRouter.Builder> Reverse routing. Lookup the uri associated with a controller method.- Author:
- Joe Lauer (jjlauer)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classReverseRouter.Builder
 - 
Constructor SummaryConstructors Constructor Description ReverseRouter(NinjaProperties ninjaProperties, Router router)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ReverseRouter.Builderwith(Class<?> controllerClass, String methodName)Retrieves a the reverse route for this controllerClass and method.ReverseRouter.Builderwith(ControllerMethods.ControllerMethod controllerMethod)Retrieves a the reverse route for a method referenced with Java-8 lambdas (functional method references).ReverseRouter.Builderwith(MethodReference methodRef)Retrieves a the reverse route for the method reference (e.g.
 
- 
- 
- 
Constructor Detail- 
ReverseRouter@Inject public ReverseRouter(NinjaProperties ninjaProperties, Router router) 
 
- 
 - 
Method Detail- 
withpublic ReverseRouter.Builder with(Class<?> controllerClass, String methodName) Retrieves a the reverse route for this controllerClass and method.- Parameters:
- controllerClass- The controllerClass e.g. ApplicationController.class
- methodName- the methodName of the class e.g. "index"
- Returns:
- A Builderallowing setting path placeholders and queryParam string parameters.
 
 - 
withpublic ReverseRouter.Builder with(MethodReference methodRef) Retrieves a the reverse route for the method reference (e.g. controller class and method name).- Parameters:
- methodRef- The reference to a method
- Returns:
- A Builderallowing setting path placeholders and queryParam string parameters.
 
 - 
withpublic ReverseRouter.Builder with(ControllerMethods.ControllerMethod controllerMethod) Retrieves a the reverse route for a method referenced with Java-8 lambdas (functional method references).- Specified by:
- within interface- WithControllerMethod<ReverseRouter.Builder>
- Parameters:
- controllerMethod- The Java-8 style method reference such as- ApplicationController::index.
- Returns:
- A Builderallowing setting path placeholders and queryParam string parameters.
 
 
- 
 
-