Class RouteImpl
java.lang.Object
spark.RouteImpl
- Direct Known Subclasses:
ResponseTransformerRouteImpl, TemplateViewRouteImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RouteImplWraps the route in RouteImplstatic RouteImplWraps the route in RouteImpldelegate()getPath()abstract ObjectInvoked when a request is made on this route's corresponding path e.g.This method should render the given element into something that can be send through Response element.withPrefix(String prefix) Prefix the path (used forService.path(String, RouteGroup))
-
Field Details
-
DEFAULT_ACCEPT_TYPE
- See Also:
-
path
-
acceptType
-
delegate
-
-
Constructor Details
-
RouteImpl
Constructor- Parameters:
path- The route path which is used for matching. (e.g. /hello, users/:name)
-
RouteImpl
-
RouteImpl
-
-
Method Details
-
withPrefix
Prefix the path (used forService.path(String, RouteGroup))- Parameters:
prefix- the prefix- Returns:
- itself for easy chaining
-
create
-
create
-
handle
Invoked when a request is made on this route's corresponding path e.g. '/hello' -
render
This method should render the given element into something that can be send through Response element. By default this method returns the result of calling toString method in given element, but can be overridden.- Parameters:
element- to be rendered.- Returns:
- body content.
- Throws:
Exception- when render fails
-
getAcceptType
- Returns:
- the accept type
-
getPath
- Returns:
- the path
-
delegate
-