Package com.robothy.netty.router
Class SpringWebRouter
java.lang.Object
com.robothy.netty.router.AbstractRouter
com.robothy.netty.router.SpringWebRouter
- All Implemented Interfaces:
Router
public class SpringWebRouter extends AbstractRouter
-
Field Summary
Fields inherited from interface com.robothy.netty.router.Router
DEFAULT_NOT_FOUND_HANDLER -
Constructor Summary
Constructors Constructor Description SpringWebRouter() -
Method Summary
Modifier and Type Method Description HttpRequestHandlermatch(HttpRequest request)Find a handler for the given request according to registered routes.Routerroute(Route rule)Register a handler for the request that matched rule.Methods inherited from class com.robothy.netty.router.AbstractRouter
exceptionHandler, findExceptionHandler, notFound, notFoundHandler, staticResource, staticResourceMatcherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SpringWebRouter
public SpringWebRouter()
-
-
Method Details
-
route
Description copied from interface:RouterRegister a handler for the request that matched rule.- Parameters:
rule- match conditions- Returns:
- this
-
match
Description copied from interface:RouterFind a handler for the given request according to registered routes. And set the extracted path parameters to HttpRequest.parameters(String).- Parameters:
request- HTTP request.- Returns:
- a matched handler; or
nullif no matched handlers.
-