Package spark
Class Routable
java.lang.Object
spark.Routable
- Direct Known Subclasses:
Service
Routable abstract class. Lets extending classes inherit default routable functionality.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addFilter
(String httpMethod, FilterImpl filter) Deprecated.protected abstract void
addFilter
(HttpMethod httpMethod, FilterImpl filter) Adds a filterprotected abstract void
Deprecated.protected abstract void
addRoute
(HttpMethod httpMethod, RouteImpl route) Adds a routevoid
Maps a filter to be executed after any matching routesvoid
Maps a filter to be executed after any matching routesvoid
Maps a filter to be executed after any matching routesvoid
afterAfter
(String path, Filter filter) Maps a filter to be executed after any matching routes even if the route throws any exceptionvoid
afterAfter
(Filter filter) Maps a filter to be executed after any matching routes even if the route throws any exceptionvoid
Maps a filter to be executed before any matching routesvoid
Maps a filter to be executed before any matching routesvoid
Maps a filter to be executed before any matching routesvoid
Map the route for HTTP CONNECT requestsvoid
connect
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP CONNECT requestsvoid
connect
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP CONNECT requestsvoid
Map the route for HTTP CONNECT requestsvoid
connect
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP CONNECT requestsvoid
connect
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP CONNECT requestsprivate RouteImpl
createRouteImpl
(String path, String acceptType, Route route) Create route implementation or use default response transformerprivate RouteImpl
createRouteImpl
(String path, Route route) Create route implementation or use default response transformervoid
defaultResponseTransformer
(ResponseTransformer transformer) Sets default response transformervoid
Map the route for HTTP DELETE requestsvoid
delete
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP DELETE requestsvoid
delete
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP DELETE requestsvoid
Map the route for HTTP DELETE requestsvoid
delete
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP DELETE requestsvoid
delete
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP DELETE requestsvoid
Map the route for HTTP GET requestsvoid
get
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP GET requestsvoid
get
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP GET requestsvoid
Map the route for HTTP GET requestsvoid
get
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP GET requestsvoid
get
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP GET requestsvoid
Map the route for HTTP HEAD requestsvoid
head
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP HEAD requestsvoid
head
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP HEAD requestsvoid
Map the route for HTTP HEAD requestsvoid
head
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP HEAD requestsvoid
head
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP HEAD requestsvoid
Map the route for HTTP OPTIONS requestsvoid
options
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP OPTIONS requestsvoid
options
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP OPTIONS requestsvoid
Map the route for HTTP OPTIONS requestsvoid
options
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP OPTIONS requestsvoid
options
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP OPTIONS requestsvoid
Map the route for HTTP PATCH requestsvoid
patch
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP PATCH requestsvoid
patch
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PATCH requestsvoid
Map the route for HTTP PATCH requestsvoid
patch
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP PATCH requestsvoid
patch
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PATCH requestsvoid
Map the route for HTTP POST requestsvoid
post
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP POST requestsvoid
post
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP POST requestsvoid
Map the route for HTTP POST requestsvoid
post
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP POST requestsvoid
post
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP POST requestsvoid
Map the route for HTTP PUT requestsvoid
put
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP PUT requestsvoid
put
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PUT requestsvoid
Map the route for HTTP PUT requestsvoid
put
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP PUT requestsvoid
put
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PUT requestsvoid
Map the route for HTTP TRACE requestsvoid
trace
(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP TRACE requestsvoid
trace
(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP TRACE requestsvoid
Map the route for HTTP TRACE requestsvoid
trace
(String path, Route route, ResponseTransformer transformer) Map the route for HTTP TRACE requestsvoid
trace
(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP TRACE requests
-
Field Details
-
defaultResponseTransformer
-
-
Constructor Details
-
Routable
Routable()
-
-
Method Details
-
addRoute
Adds a route- Parameters:
httpMethod
- the HTTP methodroute
- the route implementation
-
addRoute
Deprecated. -
addFilter
Adds a filter- Parameters:
httpMethod
- the HTTP methodfilter
- the route implementation
-
addFilter
Deprecated. -
get
Map the route for HTTP GET requests- Parameters:
path
- the pathroute
- The route
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathroute
- The route
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathroute
- The route
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathroute
- The route
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathroute
- The route
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathroute
- The route
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathroute
- The route
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathroute
- The route
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathroute
- The route
-
before
Maps a filter to be executed before any matching routes- Parameters:
path
- the pathfilter
- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
path
- the pathfilter
- The filter
-
get
Map the route for HTTP GET requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The route
-
before
Maps a filter to be executed before any matching routes- Parameters:
filter
- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
filter
- The filter
-
before
Maps a filter to be executed before any matching routes- Parameters:
path
- the pathacceptType
- the accept typefilter
- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
path
- the pathacceptType
- the accept typefilter
- The filter
-
afterAfter
Maps a filter to be executed after any matching routes even if the route throws any exception- Parameters:
filter
- The filter
-
afterAfter
Maps a filter to be executed after any matching routes even if the route throws any exception- Parameters:
filter
- The filter
-
get
Map the route for HTTP GET requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
get
Map the route for HTTP GET requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathroute
- The routeengine
- the template engine
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routeengine
- the template engine
-
get
Map the route for HTTP GET requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
get
Map the route for HTTP GET requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
post
Map the route for HTTP POST requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
put
Map the route for HTTP PUT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
delete
Map the route for HTTP DELETE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
head
Map the route for HTTP HEAD requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
trace
Map the route for HTTP TRACE requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathroute
- The routetransformer
- the response transformer
-
patch
Map the route for HTTP PATCH requests- Parameters:
path
- the pathacceptType
- the accept typeroute
- The routetransformer
- the response transformer
-
createRouteImpl
Create route implementation or use default response transformer- Parameters:
path
- the pathacceptType
- the accept typeroute
- the route- Returns:
- ResponseTransformerRouteImpl or RouteImpl
-
createRouteImpl
Create route implementation or use default response transformer- Parameters:
path
- the pathroute
- the route- Returns:
- ResponseTransformerRouteImpl or RouteImpl
-
defaultResponseTransformer
Sets default response transformer- Parameters:
transformer
-
-