public class FallbackRoute extends Object implements RouteWithFilter
Route.After, Route.Before, Route.Chain, Route.Collection, Route.Complete, Route.Definition, Route.Filter, Route.Forwarding, Route.Group, Route.Handler, Route.Mapper<T>, Route.MethodHandler, Route.OneArgHandler, Route.Props<T extends Route.Props<T>>, Route.Source, Route.ZeroArgHandler
Constructor and Description |
---|
FallbackRoute(String name,
String method,
String path,
List<MediaType> produces,
Route.Filter filter) |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(String prefix)
True, when route's name starts with the given prefix.
|
Map<String,Object> |
attributes() |
List<MediaType> |
consumes() |
boolean |
glob()
|
void |
handle(Request req,
Response rsp,
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()
Route's name, helpful for debugging but also to implement dynamic and advanced routing.
|
String |
path() |
String |
pattern() |
List<MediaType> |
produces() |
String |
renderer()
Explicit renderer to use or
null . |
String |
reverse(Map<String,Object> vars)
Recreate a route path and apply the given variables.
|
String |
reverse(Object... values)
Recreate a route path and apply the given variables.
|
Route.Source |
source()
Source information (where the route was defined).
|
Map<Object,String> |
vars()
Path variables, either named or by index (capturing group).
|
public String renderer()
Route
null
.public String pattern()
public String name()
Route
Route.Chain.next(String, Request, Response)
public Map<Object,String> vars()
Route
/path/:varVariable
var
is accessible by name: var
or index: 0
.public Map<String,Object> attributes()
attributes
in interface Route
public boolean glob()
Route
glob
in interface Route
Route.pattern()
contains a glob charecter, like ?
,
*
or **
.public String reverse(Map<String,Object> vars)
Route
public String reverse(Object... values)
Route
public Route.Source source()
Route
public void handle(Request req, Response rsp, Route.Chain chain) throws Throwable
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
req
- A HTTP request.rsp
- A HTTP response.chain
- A route chain.Throwable
- If something goes wrong.public boolean apply(String prefix)
Route
Route.Chain.next(String, Request, Response)
Copyright © 2017. All rights reserved.