Package org.spincast.core.routing
Interface Route<R extends RequestContext<?>>
- All Known Implementing Classes:
RouteDefault
public interface Route<R extends RequestContext<?>>
Represents a regular route and all its informations.
-
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 ifisStaticResourceRoute()
) 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?
-
Method Details
-
getId
String getId()The route id. -
getClasses
The route's classes. -
isWebsocketRoute
boolean isWebsocketRoute()Is this a Websocket route? -
isStaticResourceRoute
boolean isStaticResourceRoute()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.
-
getStaticResource
StaticResource<R> getStaticResource()Returns theStaticResource
to serve ornull
if this is not a route for a static resource (ie ifisStaticResourceRoute()
) doesn't returntrue
. -
isSpicastCoreRouteOrPluginRoute
boolean isSpicastCoreRouteOrPluginRoute()Is this a route added by Spincast itself or by a plugin? Otherwise, the route is considered as an application route. -
getPath
String getPath()The route path. -
isSkipResourcesRequests
boolean isSkipResourcesRequests()Should a request for a resource be skipped?Only used if the current route is a filter.
-
getHttpMethods
Set<HttpMethod> getHttpMethods()TheHTTP methods
this route applies to. -
getAcceptedContentTypes
TheContent-Types
this route accepts (names all lowercased). -
getRoutingTypes
Set<RoutingType> getRoutingTypes()Therouting types
the route should be considered for. -
getMainHandler
The main handler. -
getBeforeFilters
The "before" filters, if any. -
getAfterFilters
The "after" filters, if any. -
getPosition
int getPosition()The position at which this route should be run during a routing process. -
getFilterIdsToSkip
The ids of the filters that should be skipped for this route. -
getSpecs
Object getSpecs()The optional specs for the route. -
getSpecsParameters
Optional specs parameters. -
isSpecsIgnore
boolean isSpecsIgnore()Is this route ignored when specs are generated?
-