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:
AnnotatedElement,AnnotationMetadata,AnnotationMetadataDelegate,AnnotationMetadataProvider,AnnotationSource,Named,UriMatchInfo,ExecutionHandle<T,,R> MethodExecutionHandle<T,,R> 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
- Author:
- Graeme Rocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConversionServiceprotected final ExecutableMethod<T,R> protected final MethodExecutionHandle<T,R> protected final MethodBasedRouteInfo<T,R> protected final UnsafeExecutionHandle<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(RequestBinderRegistry requestBinderRegistry, HttpRequest<?> request) Attempt to satisfy the arguments of the given route with the data from the given request.voidfulfillBeforeFilters(RequestBinderRegistry requestBinderRegistry, HttpRequest<?> request) Attempt to satisfy the arguments of the given route with the data from the given request.Supplies the metadata.Argument<?>[]The underlyingExecutableMethodreference.getRequiredInput(String name) Return whether the given named input is required by this route.The target of the method invocation.getUri()Invokes the method.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
-
routeInfo
-
methodExecutionHandle
-
unsafeMethodExecutionHandle
-
executableMethod
-
-
Method Details
-
getUri
- Specified by:
getUriin interfaceUriMatchInfo- Returns:
- The matched URI
-
getVariableValues
- Specified by:
getVariableValuesin interfaceRouteMatch<T>- Specified by:
getVariableValuesin interfaceUriMatchInfo- Returns:
- The variable values following a successful match
-
getVariables
- Specified by:
getVariablesin interfaceUriMatchInfo- Returns:
- The list of template variables
-
getVariableMap
- Specified by:
getVariableMapin interfaceUriMatchInfo- Returns:
- A map of the variables.
-
getRouteInfo
- Specified by:
getRouteInfoin interfaceRouteMatch<T>- Specified by:
getRouteInfoin interfaceUriRouteMatch<T,R> - Returns:
- The route info
-
getHttpMethod
- Specified by:
getHttpMethodin interfaceUriRouteMatch<T,R> - Returns:
- The matched HTTP method
-
toString
-
getTarget
Description copied from interface:ExecutionHandleThe target of the method invocation.- Specified by:
getTargetin interfaceExecutionHandle<T,R> - Returns:
- The target object
-
getExecutableMethod
Description copied from interface:MethodExecutionHandleThe underlyingExecutableMethodreference.- Specified by:
getExecutableMethodin interfaceMethodExecutionHandle<T,R> - Returns:
- The underlying method reference.
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
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 interfaceMethodReference<T,R> - Returns:
- The target method
-
getMethodName
- Specified by:
getMethodNamein interfaceMethodReference<T,R> - Returns:
- The name of the method
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceExecutionHandle<T,R> - Specified by:
getDeclaringTypein interfaceMethodReference<T,R> - Returns:
- The declaring type
-
getArguments
- Specified by:
getArgumentsin interfaceExecutionHandle<T,R> - Specified by:
getArgumentsin interfaceMethodReference<T,R> - Returns:
- The required argument types.
-
getReturnType
- Specified by:
getReturnTypein interfaceMethodReference<T,R> - Returns:
- Return the return type
-
invoke
Description copied from interface:ExecutionHandleInvokes the method.- Specified by:
invokein interfaceExecutionHandle<T,R> - Parameters:
arguments- The arguments- Returns:
- The result
-
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(RequestBinderRegistry requestBinderRegistry, 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(RequestBinderRegistry requestBinderRegistry, 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
-