Package io.micronaut.web.router
Class DefaultUrlRouteInfo<T,R>
java.lang.Object
io.micronaut.web.router.DefaultRouteInfo<R>
io.micronaut.web.router.DefaultRequestMatcher<T,R>
io.micronaut.web.router.DefaultUrlRouteInfo<T,R>
- Type Parameters:
T- The targetR- The result
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource,io.micronaut.http.uri.UriMatcher,MethodBasedRouteInfo<T,,R> RequestMatcher,RouteInfo<R>,UriRouteInfo<T,,R> Comparable<UriRouteInfo<T,R>>
@Internal
public final class DefaultUrlRouteInfo<T,R>
extends DefaultRequestMatcher<T,R>
implements UriRouteInfo<T,R>
The default
UriRouteInfo implementation.- Since:
- 4.0.0
-
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
ConstructorsConstructorDescriptionDefaultUrlRouteInfo(io.micronaut.http.HttpMethod httpMethod, io.micronaut.http.uri.UriMatchTemplate uriMatchTemplate, Charset defaultCharset, io.micronaut.inject.MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable io.micronaut.core.type.Argument<?> bodyArgument, List<io.micronaut.http.MediaType> consumesMediaTypes, List<io.micronaut.http.MediaType> producesMediaTypes, List<Predicate<io.micronaut.http.HttpRequest<?>>> predicates, Integer port, io.micronaut.core.convert.ConversionService conversionService, io.micronaut.scheduling.executor.ExecutorSelector executorSelector, io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NonNull UriRouteInfo o) String[]getExecutor(io.micronaut.scheduling.executor.ThreadSelection threadSelection) Optional<io.micronaut.core.type.Argument<?>>LikeRouteInfo.getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e.io.micronaut.http.HttpMethodfinal io.micronaut.http.body.MessageBodyReader<?>getPort()Optional<io.micronaut.core.type.Argument<?>>io.micronaut.http.uri.UriMatchTemplatebooleanisVoid()Match this route within the given URI and produce aRouteMatchif a match is found.booleanio.micronaut.http.bind.binders.RequestArgumentBinder<Object>[]resolveArgumentBinders(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry) toString()Match this route within the given URI and produce aRouteMatchif a match is found.Methods inherited from class io.micronaut.web.router.DefaultRequestMatcher
matchingMethods inherited from class io.micronaut.web.router.DefaultRouteInfo
consumesAll, doesConsume, doesProduce, doesProduce, explicitlyConsumes, explicitlyProduces, findStatus, getAnnotationMetadata, getConsumes, getDeclaringType, 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, 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, findStatus, getBodyArgument, getBodyType, getConsumes, getDeclaringType, getFullRequestBodyType, getMessageBodyReader, getMessageBodyWriter, getProduces, getRequestBodyType, getResponseBodyType, getReturnType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isImperative, isPermitsRequestBody, isReactive, isResponseBodyJsonFormattable, isSingleResult, isSpecifiedSingle, isSuspended, isVoid, isWebSocketRoute, needsRequestBody, producesAllMethods inherited from interface io.micronaut.web.router.UriRouteInfo
getHttpMethodName, match, tryMatch
-
Constructor Details
-
DefaultUrlRouteInfo
public DefaultUrlRouteInfo(io.micronaut.http.HttpMethod httpMethod, io.micronaut.http.uri.UriMatchTemplate uriMatchTemplate, Charset defaultCharset, io.micronaut.inject.MethodExecutionHandle<T, R> targetMethod, @Nullable @Nullable String bodyArgumentName, @Nullable @Nullable io.micronaut.core.type.Argument<?> bodyArgument, List<io.micronaut.http.MediaType> consumesMediaTypes, List<io.micronaut.http.MediaType> producesMediaTypes, List<Predicate<io.micronaut.http.HttpRequest<?>>> predicates, Integer port, io.micronaut.core.convert.ConversionService conversionService, io.micronaut.scheduling.executor.ExecutorSelector executorSelector, io.micronaut.http.body.MessageBodyHandlerRegistry messageBodyHandlerRegistry)
-
-
Method Details
-
getHttpMethod
public io.micronaut.http.HttpMethod getHttpMethod()- Specified by:
getHttpMethodin interfaceUriRouteInfo<T,R> - Returns:
- The HTTP method for this route
-
getUriMatchTemplate
public io.micronaut.http.uri.UriMatchTemplate getUriMatchTemplate()- Specified by:
getUriMatchTemplatein interfaceUriRouteInfo<T,R> - Returns:
- The
UriMatchTemplateused to match URIs
-
match
Description copied from interface:UriRouteInfoMatch this route within the given URI and produce aRouteMatchif a match is found.- Specified by:
matchin interfaceio.micronaut.http.uri.UriMatcher- Specified by:
matchin interfaceUriRouteInfo<T,R> - Parameters:
uri- The URI- Returns:
- An
OptionalofRouteMatch
-
tryMatch
Description copied from interface:UriRouteInfoMatch this route within the given URI and produce aRouteMatchif a match is found.- Specified by:
tryMatchin interfaceUriRouteInfo<T,R> - Parameters:
uri- The URI- Returns:
- A null or a
RouteMatch
-
getPort
- Specified by:
getPortin interfaceUriRouteInfo<T,R> - Returns:
- The port the route listens to, or null if the default port
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
toString
-
getExecutor
public ExecutorService getExecutor(io.micronaut.scheduling.executor.ThreadSelection threadSelection) - Specified by:
getExecutorin interfaceRouteInfo<T>- Overrides:
getExecutorin classDefaultRouteInfo<R>- Parameters:
threadSelection- The thread selection- Returns:
- The route executor
-
getMessageBodyReader
public final io.micronaut.http.body.MessageBodyReader<?> getMessageBodyReader()- Specified by:
getMessageBodyReaderin interfaceRouteInfo<T>- Returns:
- The message body reader. if any.
-
resolveArgumentBinders
public io.micronaut.http.bind.binders.RequestArgumentBinder<Object>[] resolveArgumentBinders(io.micronaut.http.bind.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
-