Package io.micronaut.web.router
Class DefaultUriRouteMatch<T,R>
java.lang.Object
io.micronaut.web.router.DefaultUriRouteMatch<T,R>
- Type Parameters:
T- The target typeR- The return type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotatedElement,io.micronaut.core.annotation.AnnotationMetadata,io.micronaut.core.annotation.AnnotationMetadataDelegate,io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource,io.micronaut.core.naming.Named,io.micronaut.http.uri.UriMatchInfo,io.micronaut.inject.ExecutionHandle<T,,R> io.micronaut.inject.MethodExecutionHandle<T,,R> io.micronaut.inject.MethodReference<T,,R> MethodBasedRouteMatch<T,,R> RouteMatch<R>,UriRouteMatch<T,,R> Callable<R>
Default implementation of the
RouteMatch interface for matches to URIs.- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.micronaut.core.convert.ConversionServiceprotected final MethodBasedRouteInfo<T,R> Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionexecute()Execute the route with the given values.voidFulfill argument values.voidfulfillAfterFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request) Attempt to satisfy the arguments of the given route with the data from the given request.voidfulfillBeforeFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request) Attempt to satisfy the arguments of the given route with the data from the given request.@NonNull io.micronaut.core.annotation.AnnotationMetadataio.micronaut.core.type.Argument<?>[]io.micronaut.http.HttpMethodOptional<io.micronaut.core.type.Argument<?>>getRequiredInput(String name) Return whether the given named input is required by this route.io.micronaut.core.type.ReturnType<R>getUri()List<io.micronaut.http.uri.UriMatchVariable>booleanbooleanisSatisfied(String name) Is the given input satisfied.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
getAnnotationMetadataMethods inherited from interface io.micronaut.inject.ExecutionHandle
getArguments, getDeclaringType, getTarget, invokeMethods inherited from interface io.micronaut.inject.MethodExecutionHandle
getExecutableMethodMethods inherited from interface io.micronaut.inject.MethodReference
getArgumentNames, getArguments, getArgumentTypes, getDeclaringType, getMethodName, getName, getReturnType, getTargetMethodMethods inherited from interface io.micronaut.web.router.RouteMatch
call, execute, fulfill, fulfillAfterFilters, fulfillBeforeFilters, getRequiredInput, isFulfilled, isSatisfiedMethods inherited from interface io.micronaut.web.router.UriRouteMatch
getRequiredArguments
-
Field Details
-
conversionService
protected final io.micronaut.core.convert.ConversionService conversionService -
routeInfo
-
methodExecutionHandle
-
unsafeMethodExecutionHandle
-
executableMethod
-
-
Method Details
-
getUri
- Specified by:
getUriin interfaceio.micronaut.http.uri.UriMatchInfo
-
getVariableValues
- Specified by:
getVariableValuesin interfaceRouteMatch<T>- Specified by:
getVariableValuesin interfaceio.micronaut.http.uri.UriMatchInfo- Returns:
- The variable values following a successful match.
-
getVariables
- Specified by:
getVariablesin interfaceio.micronaut.http.uri.UriMatchInfo
-
getVariableMap
- Specified by:
getVariableMapin interfaceio.micronaut.http.uri.UriMatchInfo
-
getRouteInfo
- Specified by:
getRouteInfoin interfaceRouteMatch<T>- Specified by:
getRouteInfoin interfaceUriRouteMatch<T,R> - Returns:
- The route info
-
getHttpMethod
public io.micronaut.http.HttpMethod getHttpMethod()- Specified by:
getHttpMethodin interfaceUriRouteMatch<T,R> - Returns:
- The matched HTTP method
-
toString
-
getTarget
- Specified by:
getTargetin interfaceio.micronaut.inject.ExecutionHandle<T,R>
-
getExecutableMethod
- Specified by:
getExecutableMethodin interfaceio.micronaut.inject.MethodExecutionHandle<T,R>
-
getAnnotationMetadata
@NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getRequiredInput
Description copied from interface:RouteMatchReturn whether the given named input is required by this route.- Specified by:
getRequiredInputin interfaceRouteMatch<T>- Parameters:
name- The name of the input- Returns:
- True if it is
-
isFulfilled
public boolean isFulfilled()- Specified by:
isFulfilledin interfaceRouteMatch<T>- Returns:
- Whether the route match can be executed without passing any additional arguments i.e. via
RouteMatch.execute()
-
isSatisfied
Description copied from interface:RouteMatchIs the given input satisfied.- Specified by:
isSatisfiedin interfaceRouteMatch<T>- Parameters:
name- The name of the input- Returns:
- True if it is
-
getTargetMethod
- Specified by:
getTargetMethodin interfaceio.micronaut.inject.MethodReference<T,R>
-
getMethodName
- Specified by:
getMethodNamein interfaceio.micronaut.inject.MethodReference<T,R>
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceio.micronaut.inject.ExecutionHandle<T,R> - Specified by:
getDeclaringTypein interfaceio.micronaut.inject.MethodReference<T,R>
-
getArguments
public io.micronaut.core.type.Argument<?>[] getArguments()- Specified by:
getArgumentsin interfaceio.micronaut.inject.ExecutionHandle<T,R> - Specified by:
getArgumentsin interfaceio.micronaut.inject.MethodReference<T,R>
-
getReturnType
- Specified by:
getReturnTypein interfaceio.micronaut.inject.MethodReference<T,R>
-
invoke
- Specified by:
invokein interfaceio.micronaut.inject.ExecutionHandle<T,R>
-
execute
Description copied from interface:RouteMatchExecute the route with the given values. Note if there are required arguments returned fromRouteMatch.getRequiredArguments()this method will throw anIllegalArgumentException.- Specified by:
executein interfaceRouteMatch<T>- Returns:
- The result
-
fulfill
Description copied from interface:RouteMatchFulfill argument values.- Specified by:
fulfillin interfaceRouteMatch<T>- Parameters:
newValues- The argument values
-
fulfillBeforeFilters
public void fulfillBeforeFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request) Description copied from interface:RouteMatchAttempt to satisfy the arguments of the given route with the data from the given request.- Specified by:
fulfillBeforeFiltersin interfaceRouteMatch<T>- Parameters:
requestBinderRegistry- The request binder registryrequest- The request
-
fulfillAfterFilters
public void fulfillAfterFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request) Description copied from interface:RouteMatchAttempt to satisfy the arguments of the given route with the data from the given request.- Specified by:
fulfillAfterFiltersin interfaceRouteMatch<T>- Parameters:
requestBinderRegistry- The request binder registryrequest- The request
-