public class Routes extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Routes()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String route,
String acceptType,
Object target)
Parse and validates a route and adds it
|
void |
clear()
¨Clear all routes
|
static Routes |
create() |
RouteMatch |
find(HttpMethod httpMethod,
String path,
String acceptType)
finds target for a requested route
|
List<RouteMatch> |
findMultiple(HttpMethod httpMethod,
String path,
String acceptType)
Finds multiple targets for a requested route.
|
boolean |
remove(String path)
Removes a particular route from the collection of those that have been previously routed.
|
boolean |
remove(String path,
String httpMethod)
Removes a particular route from the collection of those that have been previously routed.
|
public static Routes create()
public void add(String route, String acceptType, Object target)
route - the route pathacceptType - the accept typetarget - the invocation targetpublic RouteMatch find(HttpMethod httpMethod, String path, String acceptType)
httpMethod - the http methodpath - the pathacceptType - the accept typepublic List<RouteMatch> findMultiple(HttpMethod httpMethod, String path, String acceptType)
httpMethod - the http methodpath - the route pathacceptType - the accept typepublic void clear()
public boolean remove(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 remove(String path)
path - the route pathIllegalArgumentException - if path is null or blankCopyright © 2016. All rights reserved.