public class SimpleRouteMatcher extends Object
Constructor and Description |
---|
SimpleRouteMatcher()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearRoutes()
¨Clear all routes
|
RouteMatch |
findTargetForRequestedRoute(HttpMethod httpMethod,
String path,
String acceptType)
finds target for a requested route
|
List<RouteMatch> |
findTargetsForRequestedRoute(HttpMethod httpMethod,
String path,
String acceptType)
Finds multiple targets for a requested route.
|
void |
parseValidateAddRoute(String route,
String acceptType,
Object target)
Parse and validates a route and adds it
|
boolean |
removeRoute(String path)
Removes a particular route from the collection of those that have been previously routed.
|
boolean |
removeRoute(String path,
String httpMethod)
Removes a particular route from the collection of those that have been previously routed.
|
public void parseValidateAddRoute(String route, String acceptType, Object target)
route
- the route pathacceptType
- the accept typetarget
- the invocation targetpublic RouteMatch findTargetForRequestedRoute(HttpMethod httpMethod, String path, String acceptType)
httpMethod
- the http methodpath
- the pathacceptType
- the accept typepublic List<RouteMatch> findTargetsForRequestedRoute(HttpMethod httpMethod, String path, String acceptType)
httpMethod
- the http methodpath
- the route pathacceptType
- the accept typepublic void clearRoutes()
public boolean removeRoute(String path, String httpMethod)
path
- the route pathhttpMethod
- the http methodIllegalArgumentException
- if path is null or blank or if httpMethod is null, blank
or an invalid HTTP methodpublic boolean removeRoute(String path)
path
- the route pathIllegalArgumentException
- if path is null or blankCopyright © 2015. All rights reserved.