Package io.micronaut.web.router
Class DefaultRequestMatcher<T,R>
java.lang.Object
io.micronaut.web.router.DefaultRouteInfo<R>
io.micronaut.web.router.DefaultRequestMatcher<T,R>
- Type Parameters:
T- The targetR- The result
- All Implemented Interfaces:
AnnotationMetadataProvider,AnnotationSource,MethodBasedRouteInfo<T,,R> RequestMatcher,RouteInfo<R>
- Direct Known Subclasses:
DefaultErrorRouteInfo,DefaultStatusRouteInfo,DefaultUrlRouteInfo
@Internal
public sealed class DefaultRequestMatcher<T,R>
extends DefaultRouteInfo<R>
implements RequestMatcher
permits DefaultErrorRouteInfo<T,R>, DefaultStatusRouteInfo<T,R>, DefaultUrlRouteInfo<T,R>
The default
RequestMatcher 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
ConstructorsConstructorDescriptionDefaultRequestMatcher(MethodExecutionHandle<T, R> targetMethod, Argument<?> bodyArgument, String bodyArgumentName, List<MediaType> producesMediaTypes, List<MediaType> consumesMediaTypes, boolean isPermitsBody, boolean isErrorRoute, List<Predicate<HttpRequest<?>>> predicates, MessageBodyHandlerRegistry messageBodyHandlerRegistry) -
Method Summary
Modifier and TypeMethodDescriptionString[]LikeRouteInfo.getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e.final MessageBodyReader<?>booleanisVoid()booleanmatching(HttpRequest<?> httpRequest) Match the given request.booleanresolveArgumentBinders(RequestBinderRegistry requestBinderRegistry) Methods inherited from class io.micronaut.web.router.DefaultRouteInfo
consumesAll, doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, findStatus, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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.RouteInfo
consumesAll, doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, findStatus, getBodyArgument, getBodyType, getConsumes, getDeclaringType, getExecutor, getMessageBodyWriter, getProduces, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isImperative, isPermitsRequestBody, isReactive, isResponseBodyJsonFormattable, isSingleResult, isSpecifiedSingle, isSuspended, isWebSocketRoute, producesAll
-
Constructor Details
-
DefaultRequestMatcher
public DefaultRequestMatcher(MethodExecutionHandle<T, R> targetMethod, Argument<?> bodyArgument, String bodyArgumentName, List<MediaType> producesMediaTypes, List<MediaType> consumesMediaTypes, boolean isPermitsBody, boolean isErrorRoute, List<Predicate<HttpRequest<?>>> predicates, MessageBodyHandlerRegistry messageBodyHandlerRegistry)
-
-
Method Details
-
matching
Description copied from interface:RequestMatcherMatch the given request.- Specified by:
matchingin interfaceRequestMatcher- Parameters:
httpRequest- The request- Returns:
- true if route matches this request
-
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
-