Package io.micronaut.web.router
Class DefaultRouteInfo<R>
java.lang.Object
io.micronaut.web.router.DefaultRouteInfo<R>
- Type Parameters:
R- The result type
- All Implemented Interfaces:
AnnotationMetadataProvider,AnnotationSource,RouteInfo<R>
- Direct Known Subclasses:
DefaultRequestMatcher
The default route info implementation.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotationMetadataprotected final booleanprotected final Class<?>protected final @Nullable HttpStatusprotected final booleanprotected final booleanprotected final ReturnType<? extends R>Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.web.router.RouteInfo
DEFAULT_PRODUCES -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRouteInfo(AnnotationMetadata annotationMetadata, ReturnType<? extends R> returnType, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, Class<?> declaringType, boolean isErrorRoute, boolean isPermitsBody, MessageBodyHandlerRegistry messageBodyHandlerRegistry) DefaultRouteInfo(ReturnType<? extends R> returnType, Class<?> declaringType, boolean isErrorRoute, boolean isPermitsBody) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this is consuming any content type.booleandoesConsume(MediaType contentType) Whether the specified content type is an accepted type.booleandoesProduce(@Nullable MediaType acceptableType) Whether the route does produce any of the given types.booleandoesProduce(@Nullable Collection<MediaType> acceptableTypes) Whether the route does produce any of the given types.booleanexplicitlyConsumes(MediaType contentType) Whether the specified content type is explicitly an accepted type.booleanexplicitlyProduces(MediaType contentType) Whether the specified content type is explicitly a producing type.findStatus(HttpStatus defaultStatus) Finds predefined route http status or uses default.Supplies the metadata.The media types able to produced by this route.Class<?>getExecutor(ThreadSelection threadSelection) The media types able to produced by this route.ReturnType<? extends R>booleanisAsync()booleanbooleanbooleanbooleanIs this route recognized as imperative.booleanWhether the route permits a request body.booleanbooleanbooleanbooleanbooleanisVoid()booleanChecks if route is for web socket.booleanbooleanWhether this is producing any content type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredMethods inherited from interface io.micronaut.web.router.RouteInfo
getBodyArgument, getBodyType, getFullRequestBodyType, getMessageBodyReader, isResponseBodyJsonFormattable
-
Field Details
-
returnType
-
consumesMediaTypes
-
producesMediaTypes
-
annotationMetadata
-
declaringType
-
consumesMediaTypesContainsAll
protected final boolean consumesMediaTypesContainsAll -
producesMediaTypesContainsAll
protected final boolean producesMediaTypesContainsAll -
definedStatus
-
isWebSocketRoute
protected final boolean isWebSocketRoute
-
-
Constructor Details
-
DefaultRouteInfo
public DefaultRouteInfo(ReturnType<? extends R> returnType, Class<?> declaringType, boolean isErrorRoute, boolean isPermitsBody) -
DefaultRouteInfo
public DefaultRouteInfo(AnnotationMetadata annotationMetadata, ReturnType<? extends R> returnType, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, Class<?> declaringType, boolean isErrorRoute, boolean isPermitsBody, MessageBodyHandlerRegistry messageBodyHandlerRegistry)
-
-
Method Details
-
getMessageBodyWriter
- Specified by:
getMessageBodyWriterin interfaceRouteInfo<R>- Returns:
- The message body writer, if any.
-
getRequestBodyType
- Specified by:
getRequestBodyTypein interfaceRouteInfo<R>- Returns:
- The argument that represents the body of the request
-
getReturnType
- Specified by:
getReturnTypein interfaceRouteInfo<R>- Returns:
- The return type
-
getResponseBodyType
- Specified by:
getResponseBodyTypein interfaceRouteInfo<R>- Returns:
- The argument representing the data type being produced.
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceRouteInfo<R>- Returns:
- The declaring type of the route.
-
getProduces
Description copied from interface:RouteInfoThe media types able to produced by this route.- Specified by:
getProducesin interfaceRouteInfo<R>- Returns:
- A list of
MediaTypethat this route can produce
-
getConsumes
Description copied from interface:RouteInfoThe media types able to produced by this route.- Specified by:
getConsumesin interfaceRouteInfo<R>- Returns:
- A list of
MediaTypethat this route can produce
-
consumesAll
public boolean consumesAll()Description copied from interface:RouteInfoWhether this is consuming any content type.- Specified by:
consumesAllin interfaceRouteInfo<R>- Returns:
- True if it is
-
doesConsume
Description copied from interface:RouteInfoWhether the specified content type is an accepted type.- Specified by:
doesConsumein interfaceRouteInfo<R>- Parameters:
contentType- The content type- Returns:
- True if it is
-
producesAll
public boolean producesAll()Description copied from interface:RouteInfoWhether this is producing any content type.- Specified by:
producesAllin interfaceRouteInfo<R>- Returns:
- True if it is
-
doesProduce
Description copied from interface:RouteInfoWhether the route does produce any of the given types.- Specified by:
doesProducein interfaceRouteInfo<R>- Parameters:
acceptableTypes- The acceptable types- Returns:
- True if it is
-
doesProduce
Description copied from interface:RouteInfoWhether the route does produce any of the given types.- Specified by:
doesProducein interfaceRouteInfo<R>- Parameters:
acceptableType- The acceptable type- Returns:
- True if it is
-
explicitlyConsumes
Description copied from interface:RouteInfoWhether the specified content type is explicitly an accepted type.- Specified by:
explicitlyConsumesin interfaceRouteInfo<R>- Parameters:
contentType- The content type- Returns:
- True if it is
-
explicitlyProduces
Description copied from interface:RouteInfoWhether the specified content type is explicitly a producing type.- Specified by:
explicitlyProducesin interfaceRouteInfo<R>- Parameters:
contentType- The content type- Returns:
- True if it is
-
isSuspended
public boolean isSuspended()- Specified by:
isSuspendedin interfaceRouteInfo<R>- Returns:
- Is this route match a suspended function (Kotlin).
-
isImperative
public boolean isImperative()Description copied from interface:RouteInfoIs this route recognized as imperative.- Specified by:
isImperativein interfaceRouteInfo<R>- Returns:
- Is this route recognized as imperative.
-
isReactive
public boolean isReactive()- Specified by:
isReactivein interfaceRouteInfo<R>- Returns:
- Is the route a reactive route.
-
isSingleResult
public boolean isSingleResult()- Specified by:
isSingleResultin interfaceRouteInfo<R>- Returns:
- Does the route emit a single result or multiple results
-
isSpecifiedSingle
public boolean isSpecifiedSingle()- Specified by:
isSpecifiedSinglein interfaceRouteInfo<R>- Returns:
- Does the route emit a single result or multiple results
-
isCompletable
public boolean isCompletable()- Specified by:
isCompletablein interfaceRouteInfo<R>- Returns:
- is the return type completable
-
isAsync
public boolean isAsync() -
isAsyncOrReactive
public boolean isAsyncOrReactive()- Specified by:
isAsyncOrReactivein interfaceRouteInfo<R>- Returns:
- Is the route an async or reactive route.
-
isVoid
public boolean isVoid() -
findStatus
Description copied from interface:RouteInfoFinds predefined route http status or uses default.- Specified by:
findStatusin interfaceRouteInfo<R>- Parameters:
defaultStatus- The default status- Returns:
- The status
-
isErrorRoute
public boolean isErrorRoute()- Specified by:
isErrorRoutein interfaceRouteInfo<R>- Returns:
- True if the route was called due to an error
-
isWebSocketRoute
public boolean isWebSocketRoute()Description copied from interface:RouteInfoChecks if route is for web socket.- Specified by:
isWebSocketRoutein interfaceRouteInfo<R>- Returns:
- true if it's web socket route
-
isPermitsRequestBody
public boolean isPermitsRequestBody()Description copied from interface:RouteInfoWhether the route permits a request body.- Specified by:
isPermitsRequestBodyin interfaceRouteInfo<R>- Returns:
- True if the route permits a request body
-
getExecutor
- Specified by:
getExecutorin interfaceRouteInfo<R>- Parameters:
threadSelection- The thread selection- Returns:
- The route executor
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
needsRequestBody
public boolean needsRequestBody()- Specified by:
needsRequestBodyin interfaceRouteInfo<R>- Returns:
- true if the route needs request body to be read
-