Package io.micronaut.web.router
Interface RouteInfo<R>
- Type Parameters:
R
- The result
- All Superinterfaces:
AnnotationMetadataProvider
,AnnotationSource
- All Known Subinterfaces:
ErrorRouteInfo<T,
,R> MethodBasedRouteInfo<T,
,R> StatusRouteInfo<T,
,R> UriRouteInfo<T,
R>
- All Known Implementing Classes:
DefaultErrorRouteInfo
,DefaultMethodBasedRouteInfo
,DefaultRequestMatcher
,DefaultRouteInfo
,DefaultStatusRouteInfo
,DefaultUrlRouteInfo
Common information shared between route and route match.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionThe default media type produced by routes.Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doesConsume
(MediaType contentType) Whether the specified content type is an accepted type.boolean
doesProduce
(MediaType acceptableType) Whether the route does produce any of the given types.boolean
doesProduce
(Collection<MediaType> acceptableTypes) Whether the route does produce any of the given types.boolean
explicitlyConsumes
(MediaType contentType) Whether the specified content type is explicitly an accepted type.boolean
explicitlyProduces
(MediaType contentType) Whether the specified content type is explicitly a producing type.findStatus
(HttpStatus defaultStatus) Finds predefined route http status or uses default.Argument<?>
The media types able to produced by this route.Class<?>
getExecutor
(ThreadSelection threadSelection) LikegetBodyArgument()
, but excludes body arguments that may match only a part of the body (i.e.The media types able to produced by this route.ReturnType<? extends R>
boolean
isAsync()
boolean
boolean
boolean
boolean
Whether the route permits a request body.boolean
boolean
boolean
boolean
boolean
isVoid()
boolean
Checks if route is for web socket.boolean
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Field Details
-
DEFAULT_PRODUCES
The default media type produced by routes.
-
-
Method Details
-
getReturnType
ReturnType<? extends R> getReturnType()- Returns:
- The return type
-
getBodyType
Argument<?> getBodyType()- Returns:
- The argument representing the data type being produced.
-
getBodyArgument
- Returns:
- The argument that represents the body
-
getFullBodyArgument
LikegetBodyArgument()
, but excludes body arguments that may match only a part of the body (i.e. that have no@Body
annotation, or where the@Body
has a value set).- Returns:
- The argument that represents the body
-
getDeclaringType
Class<?> getDeclaringType()- Returns:
- The declaring type of the route.
-
getProduces
The media types able to produced by this route.- Returns:
- A list of
MediaType
that this route can produce
-
getConsumes
The media types able to produced by this route.- Returns:
- A list of
MediaType
that this route can produce
-
doesConsume
Whether the specified content type is an accepted type.- Parameters:
contentType
- The content type- Returns:
- True if it is
-
doesProduce
Whether the route does produce any of the given types.- Parameters:
acceptableTypes
- The acceptable types- Returns:
- True if it is
-
doesProduce
Whether the route does produce any of the given types.- Parameters:
acceptableType
- The acceptable type- Returns:
- True if it is
-
explicitlyConsumes
Whether the specified content type is explicitly an accepted type.- Parameters:
contentType
- The content type- Returns:
- True if it is
-
explicitlyProduces
Whether the specified content type is explicitly a producing type.- Parameters:
contentType
- The content type- Returns:
- True if it is
- Since:
- 2.5.0
-
isSuspended
boolean isSuspended()- Returns:
- Is this route match a suspended function (Kotlin).
- Since:
- 2.0.0
-
isReactive
boolean isReactive()- Returns:
- Is the route a reactive route.
- Since:
- 2.0.0
-
isSingleResult
boolean isSingleResult()- Returns:
- Does the route emit a single result or multiple results
- Since:
- 2.0
-
isSpecifiedSingle
boolean isSpecifiedSingle()- Returns:
- Does the route emit a single result or multiple results
- Since:
- 2.0
-
isCompletable
boolean isCompletable()- Returns:
- is the return type completable
- Since:
- 2.0
-
isAsync
boolean isAsync()- Returns:
- Is the route an async route.
- Since:
- 2.0.0
-
isAsyncOrReactive
boolean isAsyncOrReactive()- Returns:
- Is the route an async or reactive route.
- Since:
- 2.0.0
-
isVoid
boolean isVoid()- Returns:
- Does the route return void
- Since:
- 2.0.0
-
isErrorRoute
boolean isErrorRoute()- Returns:
- True if the route was called due to an error
- Since:
- 3.0.0
-
findStatus
Finds predefined route http status or uses default.- Parameters:
defaultStatus
- The default status- Returns:
- The status
- Since:
- 2.5.2
-
isWebSocketRoute
boolean isWebSocketRoute()Checks if route is for web socket.- Returns:
- true if it's web socket route
- Since:
- 2.5.2
-
isPermitsRequestBody
boolean isPermitsRequestBody()Whether the route permits a request body.- Returns:
- True if the route permits a request body
- Since:
- 4.0.0
-
getExecutor
- Parameters:
threadSelection
- The thread selection- Returns:
- The route executor
- Since:
- 4.0.0
-
needsRequestBody
boolean needsRequestBody()- Returns:
- true if the route needs request body to be read
- Since:
- 4.0.0
-