|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.baswell.routes.RouteByHttpMethodNameConvention
public abstract class RouteByHttpMethodNameConvention
Base class RouteByConvention that provides an implementation for respondsToMethods. The HTTP method names are taken from
the beginning of the method name (case insensitive). If the method name doesn't start with any HTTP methods then the methods
[GET, POST, PUT, DELETE] are used.
For example:
| Method Name | Route HTTP Methods |
|---|---|
| getMyResource | GET |
| getPostMyResource | GET, POST |
| getPostDeleteAnotherThing | GET, POST, DELETE |
| doSomething | GET, POST, PUT, DELETE |
| Constructor Summary | |
|---|---|
RouteByHttpMethodNameConvention()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
removeHttpMethodsFromName(java.lang.reflect.Method method)
Removes any of the HTTP method names GET, POST, PUT, DELETE, HEAD (case insensitive) from the beginning of this method name if the given method does not have a Route.respondsToMethods() specified. |
java.lang.String |
removeRoutesControllerHandlerFromName(java.lang.Class clazz)
Removes any of the following words from the very end of the given class name. |
java.util.List<HttpMethod> |
respondsToMethods(java.lang.reflect.Method routeMethod)
The HTTP method names are taken from the beginning of the method name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.baswell.routes.RouteByConvention |
|---|
routePath, routesPathPrefix |
| Constructor Detail |
|---|
public RouteByHttpMethodNameConvention()
| Method Detail |
|---|
public java.util.List<HttpMethod> respondsToMethods(java.lang.reflect.Method routeMethod)
respondsToMethods in interface RouteByConventionrouteMethod -
public java.lang.String removeRoutesControllerHandlerFromName(java.lang.Class clazz)
clazz -
RouteByConvention.routesPathPrefix(Class)protected java.lang.String removeHttpMethodsFromName(java.lang.reflect.Method method)
Route.respondsToMethods() specified. If respondsToMethods is
specified the method name is returned unaltered.
method -
RouteByConvention.routePath(java.lang.reflect.Method)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||