Package org.spincast.plugins.routing
Class RouteDefault<R extends RequestContext<?>>
java.lang.Object
org.spincast.plugins.routing.RouteDefault<R>
- All Implemented Interfaces:
Route<R>
-
Constructor Summary
ConstructorDescriptionRouteDefault
(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, Set<String> classes) Constructor -
Method Summary
Modifier and TypeMethodDescriptionTheContent-Types
this route accepts (names all lowercased).The "after" filters, if any.The "before" filters, if any.The route's classes.The ids of the filters that should be skipped for this route.TheHTTP methods
this route applies to.getId()
The route id.The main handler.getPath()
The route path.int
The position at which this route should be run during a routing process.Therouting types
the route should be considered for.getSpecs()
The optional specs for the route.Optional specs parameters.Returns theStaticResource
to serve ornull
if this is not a route for a static resource (ie ifRoute.isStaticResourceRoute()
) doesn't returntrue
.boolean
Should a request for a resource be skipped?boolean
Is this route ignored when specs are generated?boolean
Is this a route added by Spincast itself or by a plugin? Otherwise, the route is considered as an application route.boolean
Is this a route for a resource? It is if it was was started usingRouter.dir(String)
orRouter.file(String)
.boolean
Is this a Websocket route?toString()
-
Constructor Details
-
RouteDefault
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, Set<String> classes) Constructor
-
-
Method Details
-
getHttpMethods
Description copied from interface:Route
TheHTTP methods
this route applies to.- Specified by:
getHttpMethods
in interfaceRoute<R extends RequestContext<?>>
-
getAcceptedContentTypes
Description copied from interface:Route
TheContent-Types
this route accepts (names all lowercased).- Specified by:
getAcceptedContentTypes
in interfaceRoute<R extends RequestContext<?>>
-
getId
Description copied from interface:Route
The route id.- Specified by:
getId
in interfaceRoute<R extends RequestContext<?>>
-
getClasses
Description copied from interface:Route
The route's classes.- Specified by:
getClasses
in interfaceRoute<R extends RequestContext<?>>
-
isWebsocketRoute
public boolean isWebsocketRoute()Description copied from interface:Route
Is this a Websocket route?- Specified by:
isWebsocketRoute
in interfaceRoute<R extends RequestContext<?>>
-
isStaticResourceRoute
public boolean isStaticResourceRoute()Description copied from interface:Route
Is this a route for a resource? It is if it was was started usingRouter.dir(String)
orRouter.file(String)
.On a resource route, we may want to skip some filters, for example.
- Specified by:
isStaticResourceRoute
in interfaceRoute<R extends RequestContext<?>>
-
getStaticResource
Description copied from interface:Route
Returns theStaticResource
to serve ornull
if this is not a route for a static resource (ie ifRoute.isStaticResourceRoute()
) doesn't returntrue
.- Specified by:
getStaticResource
in interfaceRoute<R extends RequestContext<?>>
-
isSpicastCoreRouteOrPluginRoute
public boolean isSpicastCoreRouteOrPluginRoute()Description copied from interface:Route
Is this a route added by Spincast itself or by a plugin? Otherwise, the route is considered as an application route.- Specified by:
isSpicastCoreRouteOrPluginRoute
in interfaceRoute<R extends RequestContext<?>>
-
getPath
Description copied from interface:Route
The route path.- Specified by:
getPath
in interfaceRoute<R extends RequestContext<?>>
-
isSkipResourcesRequests
public boolean isSkipResourcesRequests()Description copied from interface:Route
Should a request for a resource be skipped?Only used if the current route is a filter.
- Specified by:
isSkipResourcesRequests
in interfaceRoute<R extends RequestContext<?>>
-
getRoutingTypes
Description copied from interface:Route
Therouting types
the route should be considered for.- Specified by:
getRoutingTypes
in interfaceRoute<R extends RequestContext<?>>
-
getBeforeFilters
Description copied from interface:Route
The "before" filters, if any.- Specified by:
getBeforeFilters
in interfaceRoute<R extends RequestContext<?>>
-
getMainHandler
Description copied from interface:Route
The main handler.- Specified by:
getMainHandler
in interfaceRoute<R extends RequestContext<?>>
-
getAfterFilters
Description copied from interface:Route
The "after" filters, if any.- Specified by:
getAfterFilters
in interfaceRoute<R extends RequestContext<?>>
-
getPosition
public int getPosition()Description copied from interface:Route
The position at which this route should be run during a routing process.- Specified by:
getPosition
in interfaceRoute<R extends RequestContext<?>>
-
getFilterIdsToSkip
Description copied from interface:Route
The ids of the filters that should be skipped for this route.- Specified by:
getFilterIdsToSkip
in interfaceRoute<R extends RequestContext<?>>
-
getSpecs
Description copied from interface:Route
The optional specs for the route.- Specified by:
getSpecs
in interfaceRoute<R extends RequestContext<?>>
-
getSpecsParameters
Description copied from interface:Route
Optional specs parameters.- Specified by:
getSpecsParameters
in interfaceRoute<R extends RequestContext<?>>
-
isSpecsIgnore
public boolean isSpecsIgnore()Description copied from interface:Route
Is this route ignored when specs are generated?- Specified by:
isSpecsIgnore
in interfaceRoute<R extends RequestContext<?>>
-
toString
-