org.baswell.routes
Class RouteByLowercaseConvention

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

public class RouteByLowercaseConvention
extends RouteByHttpMethodNameConvention

Default convention used by Routes. Performs a lowercase operation on method names to create a single path segments.

For example

Method Name Route Path
get /
getMyResource /myresource
getPostMyResource /myresource
getPostDeleteAnotherThingHere /anotherthinghere

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

Class Name Route Root Path
ApiRoutes /api
UserProfileController /userprofile

See Also:
RoutesConfiguration.routeByConvention

Constructor Summary
RouteByLowercaseConvention()
           
 
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

RouteByLowercaseConvention

public RouteByLowercaseConvention()
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.