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
,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
(@Nullable MediaType contentType) Whether the specified content type is an accepted type.boolean
doesProduce
(@Nullable MediaType acceptableType) Whether the route does produce any of the given types.boolean
doesProduce
(@Nullable Collection<MediaType> acceptableTypes) Whether the route does produce any of the given types.boolean
explicitlyConsumes
(@Nullable MediaType contentType) Whether the specified content type is explicitly an accepted type.boolean
explicitlyProduces
(@Nullable MediaType contentType) Whether the specified content type is explicitly a producing type.findStatus
(HttpStatus defaultStatus) Finds predefined route http status or uses default.Deprecated, for removal: This API element is subject to removal in a future version.default Argument<?>
Deprecated, for removal: This API element is subject to removal in a future version.UsegetResponseBodyType()
insteadThe media types able to produced by this route.Class<?>
getExecutor
(@Nullable ThreadSelection threadSelection) LikegetRequestBodyType()
, but excludes body arguments that may match only a part of the body (i.e.default @Nullable MessageBodyReader<?>
default @Nullable MessageBodyWriter<R>
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
default boolean
Is the response body json formattable.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
-
getMessageBodyWriter
- Returns:
- The message body writer, if any.
- Since:
- 4.0.0
-
getMessageBodyReader
- Returns:
- The message body reader. if any.
- Since:
- 4.0.0
-
getReturnType
ReturnType<? extends R> getReturnType()- Returns:
- The return type
-
getResponseBodyType
- Returns:
- The argument representing the data type being produced.
-
isResponseBodyJsonFormattable
default boolean isResponseBodyJsonFormattable()Is the response body json formattable.- Returns:
- The response body.
-
getBodyType
Deprecated, for removal: This API element is subject to removal in a future version.UsegetResponseBodyType()
instead- Returns:
- The response body type
-
getRequestBodyType
- Returns:
- The argument that represents the body of the request
-
getBodyArgument
Deprecated, for removal: This API element is subject to removal in a future version.UYsegetRequestBodyType()
instead- Returns:
- The argument that represents the body of the request
-
getFullRequestBodyType
LikegetRequestBodyType()
, 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
@Nullable @Nullable ExecutorService getExecutor(@Nullable @Nullable ThreadSelection threadSelection) - 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
-
getRequestBodyType()
instead