Package io.micronaut.web.router
Class DefaultErrorRouteInfo<T,R>
java.lang.Object
io.micronaut.web.router.DefaultRouteInfo<R>
io.micronaut.web.router.DefaultRequestMatcher<T,R>
io.micronaut.web.router.DefaultErrorRouteInfo<T,R>
- Type Parameters:
T- The targetR- The result
- All Implemented Interfaces:
AnnotationMetadataProvider,AnnotationSource,ErrorRouteInfo<T,,R> MethodBasedRouteInfo<T,,R> RequestMatcher,RouteInfo<R>
@Internal
public final class DefaultErrorRouteInfo<T,R>
extends DefaultRequestMatcher<T,R>
implements ErrorRouteInfo<T,R>
The default error route info 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, returnTypeFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.web.router.RouteInfo
DEFAULT_PRODUCES -
Constructor Summary
ConstructorsConstructorDescriptionDefaultErrorRouteInfo(@Nullable Class<?> originatingType, Class<? extends Throwable> exceptionType, 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 TypeMethodDescriptionbooleanfindStatus(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<?>inthashCode()booleanisVoid()Match the given exception.Match the given exception.booleanClass<?>resolveArgumentBinders(RequestBinderRegistry requestBinderRegistry) toString()Methods inherited from class io.micronaut.web.router.DefaultRequestMatcher
matchingMethods inherited from class io.micronaut.web.router.DefaultRouteInfo
consumesAll, doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, getAnnotationMetadata, getConsumes, getDeclaringType, getExecutor, getMessageBodyWriter, getProduces, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isImperative, isPermitsRequestBody, isReactive, isSingleResult, isSpecifiedSingle, isSuspended, isWebSocketRoute, producesAllMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, 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.MethodBasedRouteInfo
getArgumentNames, getTargetMethod, resolveArgumentBindersMethods inherited from interface io.micronaut.web.router.RequestMatcher
matchingMethods inherited from interface io.micronaut.web.router.RouteInfo
consumesAll, doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, getBodyArgument, getBodyType, getConsumes, getDeclaringType, getExecutor, getFullRequestBodyType, getMessageBodyReader, getMessageBodyWriter, getProduces, getRequestBodyType, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isImperative, isPermitsRequestBody, isReactive, isResponseBodyJsonFormattable, isSingleResult, isSpecifiedSingle, isSuspended, isVoid, isWebSocketRoute, needsRequestBody, producesAll
-
Constructor Details
-
DefaultErrorRouteInfo
public DefaultErrorRouteInfo(@Nullable @Nullable Class<?> originatingType, Class<? extends Throwable> exceptionType, 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:
originatingTypein interfaceErrorRouteInfo<T,R> - Returns:
- The type the exception originates from. Null if the error route is global.
-
exceptionType
- Specified by:
exceptionTypein interfaceErrorRouteInfo<T,R> - Returns:
- The type of exception
-
match
Description copied from interface:ErrorRouteInfoMatch the given exception.- Specified by:
matchin interfaceErrorRouteInfo<T,R> - Parameters:
originatingClass- The class where the error originates fromexception- The exception to match- Returns:
- The route match
-
match
Description copied from interface:ErrorRouteInfoMatch the given exception.- Specified by:
matchin interfaceErrorRouteInfo<T,R> - Parameters:
exception- The exception to match- Returns:
- The route match
-
findStatus
Description copied from interface:RouteInfoFinds predefined route http status or uses default.- Specified by:
findStatusin interfaceRouteInfo<T>- Overrides:
findStatusin classDefaultRouteInfo<R>- Parameters:
defaultStatus- The default status- Returns:
- The status
-
hashCode
public int hashCode() -
equals
-
toString
-
getMessageBodyReader
- Specified by:
getMessageBodyReaderin interfaceRouteInfo<T>- Returns:
- The message body reader. if any.
-
resolveArgumentBinders
public RequestArgumentBinder<Object>[] resolveArgumentBinders(RequestBinderRegistry requestBinderRegistry) - Specified by:
resolveArgumentBindersin interfaceMethodBasedRouteInfo<T,R>
-
isVoid
public boolean isVoid()- Specified by:
isVoidin interfaceRouteInfo<T>- Overrides:
isVoidin classDefaultRouteInfo<R>- Returns:
- Does the route return void
-
getTargetMethod
- Specified by:
getTargetMethodin interfaceMethodBasedRouteInfo<T,R> - Returns:
- The
MethodExecutionHandle
-
getRequestBodyType
- Specified by:
getRequestBodyTypein interfaceRouteInfo<T>- Overrides:
getRequestBodyTypein classDefaultRouteInfo<R>- Returns:
- The argument that represents the body of the request
-
getFullRequestBodyType
Description copied from interface:RouteInfoLikeRouteInfo.getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e. that have no@Bodyannotation, or where the@Bodyhas a value set).- Specified by:
getFullRequestBodyTypein interfaceRouteInfo<T>- Returns:
- The argument that represents the body
-
getArgumentNames
- Specified by:
getArgumentNamesin interfaceMethodBasedRouteInfo<T,R>
-
needsRequestBody
public boolean needsRequestBody()- Specified by:
needsRequestBodyin interfaceRouteInfo<T>- Overrides:
needsRequestBodyin classDefaultRouteInfo<R>- Returns:
- true if the route needs request body to be read
-