Java Code Examples for play.routing.Router#RouteDocumentation

The following examples show how to use play.routing.Router#RouteDocumentation . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParsedRoutes.java    From commercetools-sunrise-java with Apache License 2.0 5 votes vote down vote up
private static ParsedRoute parseRoute(final Router.RouteDocumentation routeDocumentation) {
    final String controllerMethodInvocation = routeDocumentation.getControllerMethodInvocation();
    if (countMatches(controllerMethodInvocation, '@') == 2) {
        final String controllerMethod = StringUtils.removeStart(controllerMethodInvocation, "@");
        final String controllerClassName = controllerMethod.substring(0, controllerMethod.indexOf("@"));
        try {
            return ParsedRoute.of(routeDocumentation, getClassByName(controllerClassName));
        } catch (ClassNotFoundException e) {
            throw new CompletionException(e);
        }
    }
    return ParsedRoute.of(routeDocumentation, null);
}
 
Example 2
Source File: ParsedRoute.java    From commercetools-sunrise-java with Apache License 2.0 4 votes vote down vote up
private ParsedRoute(final Router.RouteDocumentation routeDocumentation, @Nullable final Class<?> controllerClass) {
    this.routeDocumentation = routeDocumentation;
    this.controllerClass = controllerClass;
}
 
Example 3
Source File: ParsedRoute.java    From commercetools-sunrise-java with Apache License 2.0 4 votes vote down vote up
public Router.RouteDocumentation getRouteDocumentation() {
    return routeDocumentation;
}
 
Example 4
Source File: ParsedRoute.java    From commercetools-sunrise-java with Apache License 2.0 4 votes vote down vote up
public static ParsedRoute of(final Router.RouteDocumentation routeDocumentation, @Nullable final Class<?> controllerClass) {
    return new ParsedRoute(routeDocumentation, controllerClass);
}