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
Modifier and TypeFieldDescriptionprotected final ConversionService
protected 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_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionexecute()
Execute the route with the given values.void
Fulfill argument values.void
fulfillAfterFilters
(RequestBinderRegistry requestBinderRegistry, HttpRequest<?> request) Attempt to satisfy the arguments of the given route with the data from the given request.void
fulfillBeforeFilters
(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 underlyingExecutableMethod
reference.getRequiredInput
(String name) Return whether the given named input is required by this route.The target of the method invocation.getUri()
Invokes the method.boolean
boolean
isSatisfied
(String name) Is the given input satisfied.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods 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, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
getAnnotationMetadata
Methods inherited from interface io.micronaut.inject.ExecutionHandle
getArguments, getDeclaringType, getTarget, invoke
Methods inherited from interface io.micronaut.inject.MethodExecutionHandle
getExecutableMethod
Methods inherited from interface io.micronaut.inject.MethodReference
getArgumentNames, getArguments, getArgumentTypes, getDeclaringType, getMethodName, getName, getReturnType, getTargetMethod
Methods inherited from interface io.micronaut.web.router.RouteMatch
call, execute, fulfill, fulfillAfterFilters, fulfillBeforeFilters, getRequiredInput, isFulfilled, isSatisfied
Methods inherited from interface io.micronaut.web.router.UriRouteMatch
getRequiredArguments
-
Field Details
-
conversionService
-
routeInfo
-
methodExecutionHandle
-
unsafeMethodExecutionHandle
-
executableMethod
-
-
Method Details
-
getUri
- Specified by:
getUri
in interfaceUriMatchInfo
- Returns:
- The matched URI
-
getVariableValues
- Specified by:
getVariableValues
in interfaceRouteMatch<T>
- Specified by:
getVariableValues
in interfaceUriMatchInfo
- Returns:
- The variable values following a successful match
-
getVariables
- Specified by:
getVariables
in interfaceUriMatchInfo
- Returns:
- The list of template variables
-
getVariableMap
- Specified by:
getVariableMap
in interfaceUriMatchInfo
- Returns:
- A map of the variables.
-
getRouteInfo
- Specified by:
getRouteInfo
in interfaceRouteMatch<T>
- Specified by:
getRouteInfo
in interfaceUriRouteMatch<T,
R> - Returns:
- The route info
-
getHttpMethod
- Specified by:
getHttpMethod
in interfaceUriRouteMatch<T,
R> - Returns:
- The matched HTTP method
-
toString
-
getTarget
Description copied from interface:ExecutionHandle
The target of the method invocation.- Specified by:
getTarget
in interfaceExecutionHandle<T,
R> - Returns:
- The target object
-
getExecutableMethod
Description copied from interface:MethodExecutionHandle
The underlyingExecutableMethod
reference.- Specified by:
getExecutableMethod
in interfaceMethodExecutionHandle<T,
R> - Returns:
- The underlying method reference.
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Returns:
- The
AnnotationMetadata
-
getRequiredInput
Description copied from interface:RouteMatch
Return whether the given named input is required by this route.- Specified by:
getRequiredInput
in interfaceRouteMatch<T>
- Parameters:
name
- The name of the input- Returns:
- True if it is
-
isFulfilled
public boolean isFulfilled()- Specified by:
isFulfilled
in 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:RouteMatch
Is the given input satisfied.- Specified by:
isSatisfied
in interfaceRouteMatch<T>
- Parameters:
name
- The name of the input- Returns:
- True if it is
-
getTargetMethod
- Specified by:
getTargetMethod
in interfaceMethodReference<T,
R> - Returns:
- The target method
-
getMethodName
- Specified by:
getMethodName
in interfaceMethodReference<T,
R> - Returns:
- The name of the method
-
getDeclaringType
- Specified by:
getDeclaringType
in interfaceExecutionHandle<T,
R> - Specified by:
getDeclaringType
in interfaceMethodReference<T,
R> - Returns:
- The declaring type
-
getArguments
- Specified by:
getArguments
in interfaceExecutionHandle<T,
R> - Specified by:
getArguments
in interfaceMethodReference<T,
R> - Returns:
- The required argument types.
-
getReturnType
- Specified by:
getReturnType
in interfaceMethodReference<T,
R> - Returns:
- Return the return type
-
invoke
Description copied from interface:ExecutionHandle
Invokes the method.- Specified by:
invoke
in interfaceExecutionHandle<T,
R> - Parameters:
arguments
- The arguments- Returns:
- The result
-
execute
Description copied from interface:RouteMatch
Execute the route with the given values. Note if there are required arguments returned fromRouteMatch.getRequiredArguments()
this method will throw anIllegalArgumentException
.- Specified by:
execute
in interfaceRouteMatch<T>
- Returns:
- The result
-
fulfill
Description copied from interface:RouteMatch
Fulfill argument values.- Specified by:
fulfill
in interfaceRouteMatch<T>
- Parameters:
newValues
- The argument values
-
fulfillBeforeFilters
public void fulfillBeforeFilters(RequestBinderRegistry requestBinderRegistry, HttpRequest<?> request) Description copied from interface:RouteMatch
Attempt to satisfy the arguments of the given route with the data from the given request.- Specified by:
fulfillBeforeFilters
in interfaceRouteMatch<T>
- Parameters:
requestBinderRegistry
- The request binder registryrequest
- The request
-
fulfillAfterFilters
public void fulfillAfterFilters(RequestBinderRegistry requestBinderRegistry, HttpRequest<?> request) Description copied from interface:RouteMatch
Attempt to satisfy the arguments of the given route with the data from the given request.- Specified by:
fulfillAfterFilters
in interfaceRouteMatch<T>
- Parameters:
requestBinderRegistry
- The request binder registryrequest
- The request
-