Package io.micronaut.web.router
Class DefaultStatusRouteInfo<T,R>
java.lang.Object
io.micronaut.web.router.DefaultRouteInfo<R>
io.micronaut.web.router.DefaultRequestMatcher<T,R>
io.micronaut.web.router.DefaultStatusRouteInfo<T,R>
- Type Parameters:
T
- The targetR
- The result
- All Implemented Interfaces:
AnnotationMetadataProvider
,AnnotationSource
,MethodBasedRouteInfo<T,
,R> RequestMatcher
,RouteInfo<R>
,StatusRouteInfo<T,
R>
@Internal
public final class DefaultStatusRouteInfo<T,R>
extends DefaultRequestMatcher<T,R>
implements StatusRouteInfo<T,R>
The default
StatusRouteInfo
implementation.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from class io.micronaut.web.router.DefaultRouteInfo
annotationMetadata, consumesMediaTypes, consumesMediaTypesContainsAll, declaringType, definedStatus, isWebSocketRoute, producesMediaTypes, producesMediaTypesContainsAll, returnType
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.web.router.RouteInfo
DEFAULT_PRODUCES
-
Constructor Summary
ConstructorDescriptionDefaultStatusRouteInfo
(Class<?> originatingType, int statusCode, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, ConversionService conversionService, MessageBodyHandlerRegistry messageBodyHandlerRegistry) -
Method Summary
Modifier and TypeMethodDescriptionboolean
findStatus
(HttpStatus defaultStatus) Finds predefined route http status or uses default.String[]
LikeRouteInfo.getRequestBodyType()
, but excludes body arguments that may match only a part of the body (i.e.final MessageBodyReader<?>
int
hashCode()
boolean
isVoid()
match
(int statusCode) Match the given HTTP status.match
(HttpStatus status) Match the given HTTP status.Match the given HTTP status.match
(Class<?> originatingClass, HttpStatus status) Match the given HTTP status.boolean
Class<?>
resolveArgumentBinders
(RequestBinderRegistry requestBinderRegistry) status()
int
toString()
Methods inherited from class io.micronaut.web.router.DefaultRequestMatcher
matching
Methods inherited from class io.micronaut.web.router.DefaultRouteInfo
doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, getAnnotationMetadata, getConsumes, getDeclaringType, getExecutor, getMessageBodyWriter, getProduces, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isPermitsRequestBody, isReactive, isSingleResult, isSpecifiedSingle, isSuspended, isWebSocketRoute
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
Methods inherited from interface io.micronaut.web.router.MethodBasedRouteInfo
getArgumentNames, getTargetMethod, resolveArgumentBinders
Methods inherited from interface io.micronaut.web.router.RequestMatcher
matching
Methods inherited from interface io.micronaut.web.router.RouteInfo
doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, getBodyArgument, getBodyType, getConsumes, getDeclaringType, getExecutor, getFullRequestBodyType, getMessageBodyReader, getMessageBodyWriter, getProduces, getRequestBodyType, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isPermitsRequestBody, isReactive, isResponseBodyJsonFormattable, isSingleResult, isSpecifiedSingle, isSuspended, isVoid, isWebSocketRoute, needsRequestBody
-
Constructor Details
-
DefaultStatusRouteInfo
public DefaultStatusRouteInfo(Class<?> originatingType, int statusCode, MethodExecutionHandle<T, R> targetMethod, @Nullable @Nullable String bodyArgumentName, @Nullable @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, ConversionService conversionService, MessageBodyHandlerRegistry messageBodyHandlerRegistry)
-
-
Method Details
-
originatingType
- Specified by:
originatingType
in interfaceStatusRouteInfo<T,
R> - Returns:
- The type the exception originates from. Null if the error route is global.
-
status
- Specified by:
status
in interfaceStatusRouteInfo<T,
R> - Returns:
- The status
-
statusCode
public int statusCode()- Specified by:
statusCode
in interfaceStatusRouteInfo<T,
R> - Returns:
- The status
-
findStatus
Description copied from interface:RouteInfo
Finds predefined route http status or uses default.- Specified by:
findStatus
in interfaceRouteInfo<T>
- Overrides:
findStatus
in classDefaultRouteInfo<R>
- Parameters:
defaultStatus
- The default status- Returns:
- The status
-
match
Description copied from interface:StatusRouteInfo
Match the given HTTP status.- Specified by:
match
in interfaceStatusRouteInfo<T,
R> - Parameters:
originatingClass
- The class where the error originates fromstatus
- The status to match- Returns:
- The route match
-
match
Description copied from interface:StatusRouteInfo
Match the given HTTP status.- Specified by:
match
in interfaceStatusRouteInfo<T,
R> - Parameters:
status
- The status to match- Returns:
- The route match
-
match
Description copied from interface:StatusRouteInfo
Match the given HTTP status.- Specified by:
match
in interfaceStatusRouteInfo<T,
R> - Parameters:
statusCode
- The status to match- Returns:
- The route match
-
match
Description copied from interface:StatusRouteInfo
Match the given HTTP status.- Specified by:
match
in interfaceStatusRouteInfo<T,
R> - Parameters:
originatingClass
- The class where the error originates fromstatusCode
- The status to match- Returns:
- The route match
-
hashCode
public int hashCode() -
equals
-
toString
-
getMessageBodyReader
- Specified by:
getMessageBodyReader
in interfaceRouteInfo<T>
- Returns:
- The message body reader. if any.
-
resolveArgumentBinders
public RequestArgumentBinder<Object>[] resolveArgumentBinders(RequestBinderRegistry requestBinderRegistry) - Specified by:
resolveArgumentBinders
in interfaceMethodBasedRouteInfo<T,
R>
-
isVoid
public boolean isVoid()- Specified by:
isVoid
in interfaceRouteInfo<T>
- Overrides:
isVoid
in classDefaultRouteInfo<R>
- Returns:
- Does the route return void
-
getTargetMethod
- Specified by:
getTargetMethod
in interfaceMethodBasedRouteInfo<T,
R> - Returns:
- The
MethodExecutionHandle
-
getRequestBodyType
- Specified by:
getRequestBodyType
in interfaceRouteInfo<T>
- Overrides:
getRequestBodyType
in classDefaultRouteInfo<R>
- Returns:
- The argument that represents the body of the request
-
getFullRequestBodyType
Description copied from interface:RouteInfo
LikeRouteInfo.getRequestBodyType()
, 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).- Specified by:
getFullRequestBodyType
in interfaceRouteInfo<T>
- Returns:
- The argument that represents the body
-
getArgumentNames
- Specified by:
getArgumentNames
in interfaceMethodBasedRouteInfo<T,
R>
-
needsRequestBody
public boolean needsRequestBody()- Specified by:
needsRequestBody
in interfaceRouteInfo<T>
- Overrides:
needsRequestBody
in classDefaultRouteInfo<R>
- Returns:
- true if the route needs request body to be read
-