public class RouteImpl extends Object implements Route, Route.Filter
Route.Chain, Route.Definition, Route.Definitions, Route.Filter, Route.Forwarding, Route.Handler, Route.MethodHandler, Route.Namespace, Route.OneArgHandler, Route.ZeroArgHandler
Constructor and Description |
---|
RouteImpl(Route.Filter filter,
String method,
String path,
String pattern,
String name,
Map<Object,String> vars,
List<MediaType> consumes,
List<MediaType> produces) |
Modifier and Type | Method and Description |
---|---|
List<MediaType> |
consumes() |
static RouteImpl |
fromStatus(Route.Filter filter,
String method,
String path,
Status status,
List<MediaType> produces) |
void |
handle(Request request,
Response response,
Route.Chain chain)
The
handle method of the Filter is called by the server each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain. |
String |
method() |
String |
name() |
static RouteImpl |
notFound(String method,
String path,
List<MediaType> produces) |
String |
path() |
String |
pattern() |
List<MediaType> |
produces() |
String |
toString() |
Map<Object,String> |
vars()
Path variables, either named or by index (capturing group).
|
public static RouteImpl fromStatus(Route.Filter filter, String method, String path, Status status, List<MediaType> produces)
public void handle(Request request, Response response, Route.Chain chain) throws Exception
Route.Filter
handle
method of the Filter is called by the server each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain.
The Route.Chain
passed in to this method allows the Filter to pass on the request and
response to the next entity in the chain.
A typical implementation of this method would follow the following pattern:
Route.Chain
object (chain.next(req, rsp)
),handle
in interface Route.Filter
request
- A HTTP request.response
- A HTTP response.chain
- A route chain.Exception
- If something goes wrong.public String pattern()
public String name()
public Map<Object,String> vars()
Route
/path/:varVariable
var
is accesible by name: var
or index: 0
.Copyright © 2015. All rights reserved.