public class RouteTableRouterBuilder extends java.lang.Object implements RouterBuilder
RouteTableRouterBuilder
take a list of route map definition line and build the router. The line of a route map definition should look like:
[http-method] [url-path] [action-definition]Where http-method could be one of the following:
action-definition could be in either built-in action or controller action method.home
/
order list
/order
(dynamic) access to a certain order by ID
/order/{id}
(dynamic) access to a user by ID with regex spec
/user/{<[1-9]{5}>id}
Built-in action definition should be in a format of [directive]: [payload]
, for example
echo: hello world!
redirect: http://www.google.com
staticDir: /public
staticFile: /public/js/jquery.js
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ROUTES_FILE |
Constructor and Description |
---|
RouteTableRouterBuilder(java.util.List<java.lang.String> lines) |
RouteTableRouterBuilder(java.lang.String... lines) |
Modifier and Type | Method and Description |
---|---|
void |
build(Router router) |
public static final java.lang.String ROUTES_FILE
public RouteTableRouterBuilder(java.util.List<java.lang.String> lines)
public RouteTableRouterBuilder(java.lang.String... lines)
public void build(Router router)
build
in interface RouterBuilder
Copyright © 2014–2017 ActFramework. All rights reserved.