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:
AnnotationMetadataProvider, AnnotationSource, 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
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from class DefaultRouteInfo
annotationMetadata, consumesMediaTypes, consumesMediaTypesContainsAll, declaringType, definedStatus, isWebSocketRoute, producesMediaTypes, producesMediaTypesContainsAll, returnTypeFields inherited from interface AnnotationSource
EMPTYFields inherited from interface RouteInfo
DEFAULT_PRODUCES -
Constructor Summary
ConstructorsConstructorDescriptionDefaultUrlRouteInfo(HttpMethod httpMethod, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry) DefaultUrlRouteInfo(HttpMethod httpMethod, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry, boolean implicitHead) DefaultUrlRouteInfo(HttpMethod httpMethod, String httpMethodName, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry, boolean implicitHead) -
Method Summary
Modifier and TypeMethodDescriptionintString[]@Nullable ExecutorServicegetExecutor(@Nullable ThreadSelection threadSelection) getExecutor(ThreadSelectionConfiguration configuration) LikeRouteInfo.getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e.final @Nullable MessageBodyReader<?> @Nullable IntegergetPort()booleanbooleanisVoid()Match this route within the given URI and produce aRouteMatchif a match is found.booleanresolveArgumentBinders(RequestBinderRegistry requestBinderRegistry) toString()@Nullable UriRouteMatch<T, R> Match this route within the given URI and produce aRouteMatchif a match is found.Methods inherited from class DefaultRequestMatcher
matchingMethods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredMethods inherited from interface MethodBasedRouteInfo
getArgumentNames, getTargetMethod, resolveArgumentBindersMethods inherited from interface RequestMatcher
matchingMethods inherited from interface 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 UriRouteInfo
match, tryMatch
-
Constructor Details
-
DefaultUrlRouteInfo
public DefaultUrlRouteInfo(HttpMethod httpMethod, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry) -
DefaultUrlRouteInfo
public DefaultUrlRouteInfo(HttpMethod httpMethod, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry, boolean implicitHead) -
DefaultUrlRouteInfo
public DefaultUrlRouteInfo(HttpMethod httpMethod, String httpMethodName, UriMatchTemplate uriMatchTemplate, Charset defaultCharset, MethodExecutionHandle<T, R> targetMethod, @Nullable String bodyArgumentName, @Nullable Argument<?> bodyArgument, List<MediaType> consumesMediaTypes, List<MediaType> producesMediaTypes, List<Predicate<HttpRequest<?>>> predicates, @Nullable Integer port, ConversionService conversionService, ExecutorSelector executorSelector, MessageBodyHandlerRegistry messageBodyHandlerRegistry, boolean implicitHead) - Parameters:
httpMethod- The HTTP methodhttpMethodName- The actual name of the method - may differ fromEnum.name()for non-standard http methodsuriMatchTemplate- The URI match templatedefaultCharset- The default charsettargetMethod- The target methodbodyArgumentName- The body argument namebodyArgument- The body argumentconsumesMediaTypes- The consumed media typesproducesMediaTypes- The produced media typespredicates- The predicatesport- The portconversionService- The conversion serviceexecutorSelector- The executor selectormessageBodyHandlerRegistry- The message body handler registryimplicitHead- Whether this is an implicitHEADroute- Since:
- 5.2.3
-
-
Method Details
-
getHttpMethod
- Specified by:
getHttpMethodin interfaceUriRouteInfo<T,R> - Returns:
- The HTTP method for this route
-
getHttpMethodName
- Specified by:
getHttpMethodNamein interfaceUriRouteInfo<T,R> - Returns:
- The http method. Is equal to
UriRouteInfo.getHttpMethod()value for standard http methods.
-
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 interfaceUriMatcher- 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
-
isImplicitHead
public boolean isImplicitHead()Description copied from interface:UriRouteInfoWhether this route is an implicitHEADroute; that is, aHEADroute that was derived automatically from aGetmapping rather than declared by the user withHead.Implicit routes are fully-fledged routes and participate in matching and content negotiation exactly like any other route. The distinction is only used as a last-resort tie-break: if a request cannot be resolved to a single route and the remaining candidates contain both implicit and explicitly declared routes, the explicitly declared ones win instead of the request being rejected as ambiguous.
- Specified by:
isImplicitHeadin interfaceUriRouteInfo<T,R> - Returns:
trueif this route was derived from a@Getmapping rather than declared
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
toString
-
getExecutor
- Specified by:
getExecutorin interfaceRouteInfo<T>- Overrides:
getExecutorin classDefaultRouteInfo<R>- Parameters:
threadSelection- The thread selection- Returns:
- The route executor
-
getExecutor
- Specified by:
getExecutorin interfaceRouteInfo<T>- Overrides:
getExecutorin classDefaultRouteInfo<R>
-
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
-