org.baswell.routes
Class RouteByCamelCaseConvention

java.lang.Object
  extended by org.baswell.routes.RouteByHttpMethodNameConvention
      extended by org.baswell.routes.RouteByCamelCaseConvention
All Implemented Interfaces:
RouteByConvention

public class RouteByCamelCaseConvention
extends RouteByHttpMethodNameConvention

Uses camel case convention of method names to create new path segments.

For example

Method Name Route Path
get /
getMyResource /my/resource
getPostMyResource /my/resource
getPostDeleteAnotherThingHere /another/thing/here

The same convention is used for generating the root path from the class name.

Class Name Route Root Path
ApiRoutes /api
UserProfileController /user/profile

See Also:
RoutesConfiguration.routeByConvention

Constructor Summary
RouteByCamelCaseConvention()
           
 
Method Summary
 java.lang.String routePath(java.lang.reflect.Method routeMethod)
          The generated route path from a route method with no Route.value().
 java.lang.String routesPathPrefix(java.lang.Class routesClass)
          The generated root path of a routes class when Routes.value() is not specified.
 
Methods inherited from class org.baswell.routes.RouteByHttpMethodNameConvention
removeHttpMethodsFromName, removeRoutesControllerHandlerFromName, respondsToMethods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteByCamelCaseConvention

public RouteByCamelCaseConvention()
Method Detail

routesPathPrefix

public java.lang.String routesPathPrefix(java.lang.Class routesClass)
Description copied from interface: RouteByConvention
The generated root path of a routes class when Routes.value() is not specified. This root path will only be prepended to route method paths without Route.value().

Parameters:
routesClass - The routes class.
Returns:
The root route path.

routePath

public java.lang.String routePath(java.lang.reflect.Method routeMethod)
Description copied from interface: RouteByConvention
The generated route path from a route method with no Route.value(). The path returned here will be appended to RouteByConvention.routesPathPrefix(Class).

Returns:
The route path.