public class RouteDefault<R extends RequestContext<?>> extends Object implements Route<R>
| Constructor and Description |
|---|
RouteDefault(String id,
boolean isWebsocketRoute,
boolean isResourceRoute,
StaticResource<R> staticResource,
boolean spicastCoreRouteOrPluginRoute,
Set<HttpMethod> httpMethods,
String path,
Set<RoutingType> routingTypes,
List<Handler<R>> beforeFilters,
Handler<R> mainHandler,
List<Handler<R>> afterFilters,
int position,
Set<String> acceptedContentTypes,
Set<String> filterIdsToSkip,
boolean skipResources,
Object specs,
Object[] specsParameters,
boolean specsIgnore)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAcceptedContentTypes()
The
Content-Types this route
accepts (names all lowercased). |
List<Handler<R>> |
getAfterFilters()
The "after" filters, if any.
|
List<Handler<R>> |
getBeforeFilters()
The "before" filters, if any.
|
Set<String> |
getFilterIdsToSkip()
The ids of the filters that should be skipped for this
route.
|
Set<HttpMethod> |
getHttpMethods()
The
HTTP methods this route applies to. |
String |
getId()
The route id.
|
Handler<R> |
getMainHandler()
The main handler.
|
String |
getPath()
The route path.
|
int |
getPosition()
The position at which this route should be run during a
routing process.
|
Set<RoutingType> |
getRoutingTypes()
The
routing types the route should be considered for. |
Object |
getSpecs()
The optional specs for the route.
|
List<Object> |
getSpecsParameters()
Optional specs parameters.
|
StaticResource<R> |
getStaticResource()
Returns the
StaticResource to serve or
null if this is not a
route for a static resource (ie if
Route.isStaticResourceRoute()) doesn't return
true. |
boolean |
isSkipResourcesRequests()
Should a request for a resource be skipped?
|
boolean |
isSpecsIgnore()
Is this route ignored when specs are
generated?
|
boolean |
isSpicastCoreRouteOrPluginRoute()
Is this a route added by Spincast itself
or by a plugin? Otherwise, the route is
considered as an application route.
|
boolean |
isStaticResourceRoute()
Is this a route for a resource? It is
if it was was started using
Router.dir(String) or Router.file(String). |
boolean |
isWebsocketRoute()
Is this a Websocket route?
|
String |
toString() |
public RouteDefault(@Nullable String id, boolean isWebsocketRoute, boolean isResourceRoute, @Nullable StaticResource<R> staticResource, boolean spicastCoreRouteOrPluginRoute, Set<HttpMethod> httpMethods, String path, Set<RoutingType> routingTypes, @Nullable List<Handler<R>> beforeFilters, Handler<R> mainHandler, @Nullable List<Handler<R>> afterFilters, int position, @Nullable Set<String> acceptedContentTypes, @Nullable Set<String> filterIdsToSkip, boolean skipResources, @Nullable Object specs, @Nullable Object[] specsParameters, boolean specsIgnore)
public Set<HttpMethod> getHttpMethods()
RouteHTTP methods this route applies to.getHttpMethods in interface Route<R extends RequestContext<?>>public Set<String> getAcceptedContentTypes()
RouteContent-Types this route
accepts (names all lowercased).getAcceptedContentTypes in interface Route<R extends RequestContext<?>>public String getId()
RoutegetId in interface Route<R extends RequestContext<?>>public boolean isWebsocketRoute()
RouteisWebsocketRoute in interface Route<R extends RequestContext<?>>public boolean isStaticResourceRoute()
RouteRouter.dir(String) or Router.file(String).
On a resource route, we may want to skip some filters, for example.
isStaticResourceRoute in interface Route<R extends RequestContext<?>>public StaticResource<R> getStaticResource()
RouteStaticResource to serve or
null if this is not a
route for a static resource (ie if
Route.isStaticResourceRoute()) doesn't return
true.getStaticResource in interface Route<R extends RequestContext<?>>public boolean isSpicastCoreRouteOrPluginRoute()
RouteisSpicastCoreRouteOrPluginRoute in interface Route<R extends RequestContext<?>>public String getPath()
RoutegetPath in interface Route<R extends RequestContext<?>>public boolean isSkipResourcesRequests()
RouteOnly used if the current route is a filter.
isSkipResourcesRequests in interface Route<R extends RequestContext<?>>public Set<RoutingType> getRoutingTypes()
Routerouting types the route should be considered for.getRoutingTypes in interface Route<R extends RequestContext<?>>public List<Handler<R>> getBeforeFilters()
RoutegetBeforeFilters in interface Route<R extends RequestContext<?>>public Handler<R> getMainHandler()
RoutegetMainHandler in interface Route<R extends RequestContext<?>>public List<Handler<R>> getAfterFilters()
RoutegetAfterFilters in interface Route<R extends RequestContext<?>>public int getPosition()
RoutegetPosition in interface Route<R extends RequestContext<?>>public Set<String> getFilterIdsToSkip()
RoutegetFilterIdsToSkip in interface Route<R extends RequestContext<?>>public Object getSpecs()
RoutegetSpecs in interface Route<R extends RequestContext<?>>public List<Object> getSpecsParameters()
RoutegetSpecsParameters in interface Route<R extends RequestContext<?>>public boolean isSpecsIgnore()
RouteisSpecsIgnore in interface Route<R extends RequestContext<?>>Copyright © 2019. All rights reserved.