Class DefaultUriRouteMatch<T,R>

java.lang.Object
io.micronaut.web.router.DefaultUriRouteMatch<T,R>
Type Parameters:
T - The target type
R - 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>

@Internal public final class DefaultUriRouteMatch<T,R> extends Object implements UriRouteMatch<T,R>
Default implementation of the RouteMatch interface for matches to URIs.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final io.micronaut.core.convert.ConversionService
     
    protected final io.micronaut.inject.ExecutableMethod<T,R>
     
    protected final io.micronaut.inject.MethodExecutionHandle<T,R>
     
    protected final MethodBasedRouteInfo<T,R>
     
    protected final io.micronaut.inject.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 Type
    Method
    Description
    Execute the route with the given values.
    void
    fulfill(Map<String,Object> newValues)
    Fulfill argument values.
    void
    fulfillAfterFilters(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.
    void
    fulfillBeforeFilters(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.AnnotationMetadata
     
    io.micronaut.core.type.Argument<?>[]
     
     
    @NonNull io.micronaut.inject.ExecutableMethod<T,R>
     
    io.micronaut.http.HttpMethod
     
     
    Optional<io.micronaut.core.type.Argument<?>>
    Return whether the given named input is required by this route.
    io.micronaut.core.type.ReturnType<R>
     
     
     
     
     
    Map<String,io.micronaut.http.uri.UriMatchVariable>
     
    List<io.micronaut.http.uri.UriMatchVariable>
     
     
    invoke(Object... arguments)
     
    boolean
     
    boolean
    Is the given input satisfied.
     

    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

      protected final io.micronaut.core.convert.ConversionService conversionService
    • routeInfo

      protected final MethodBasedRouteInfo<T,R> routeInfo
    • methodExecutionHandle

      protected final io.micronaut.inject.MethodExecutionHandle<T,R> methodExecutionHandle
    • unsafeMethodExecutionHandle

      protected final io.micronaut.inject.UnsafeExecutionHandle<T,R> unsafeMethodExecutionHandle
    • executableMethod

      protected final io.micronaut.inject.ExecutableMethod<T,R> executableMethod
  • Method Details

    • getUri

      public String getUri()
      Specified by:
      getUri in interface io.micronaut.http.uri.UriMatchInfo
    • getVariableValues

      public Map<String,Object> getVariableValues()
      Specified by:
      getVariableValues in interface RouteMatch<T>
      Specified by:
      getVariableValues in interface io.micronaut.http.uri.UriMatchInfo
      Returns:
      The variable values following a successful match.
    • getVariables

      public List<io.micronaut.http.uri.UriMatchVariable> getVariables()
      Specified by:
      getVariables in interface io.micronaut.http.uri.UriMatchInfo
    • getVariableMap

      public Map<String,io.micronaut.http.uri.UriMatchVariable> getVariableMap()
      Specified by:
      getVariableMap in interface io.micronaut.http.uri.UriMatchInfo
    • getRouteInfo

      public UriRouteInfo<T,R> getRouteInfo()
      Specified by:
      getRouteInfo in interface RouteMatch<T>
      Specified by:
      getRouteInfo in interface UriRouteMatch<T,R>
      Returns:
      The route info
    • getHttpMethod

      public io.micronaut.http.HttpMethod getHttpMethod()
      Specified by:
      getHttpMethod in interface UriRouteMatch<T,R>
      Returns:
      The matched HTTP method
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTarget

      public T getTarget()
      Specified by:
      getTarget in interface io.micronaut.inject.ExecutionHandle<T,R>
    • getExecutableMethod

      @NonNull public @NonNull io.micronaut.inject.ExecutableMethod<T,R> getExecutableMethod()
      Specified by:
      getExecutableMethod in interface io.micronaut.inject.MethodExecutionHandle<T,R>
    • getAnnotationMetadata

      @NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • getRequiredInput

      public Optional<io.micronaut.core.type.Argument<?>> getRequiredInput(String name)
      Description copied from interface: RouteMatch
      Return whether the given named input is required by this route.
      Specified by:
      getRequiredInput in interface RouteMatch<T>
      Parameters:
      name - The name of the input
      Returns:
      True if it is
    • isFulfilled

      public boolean isFulfilled()
      Specified by:
      isFulfilled in interface RouteMatch<T>
      Returns:
      Whether the route match can be executed without passing any additional arguments i.e. via RouteMatch.execute()
    • isSatisfied

      public boolean isSatisfied(String name)
      Description copied from interface: RouteMatch
      Is the given input satisfied.
      Specified by:
      isSatisfied in interface RouteMatch<T>
      Parameters:
      name - The name of the input
      Returns:
      True if it is
    • getTargetMethod

      public Method getTargetMethod()
      Specified by:
      getTargetMethod in interface io.micronaut.inject.MethodReference<T,R>
    • getMethodName

      public String getMethodName()
      Specified by:
      getMethodName in interface io.micronaut.inject.MethodReference<T,R>
    • getDeclaringType

      public Class<T> getDeclaringType()
      Specified by:
      getDeclaringType in interface io.micronaut.inject.ExecutionHandle<T,R>
      Specified by:
      getDeclaringType in interface io.micronaut.inject.MethodReference<T,R>
    • getArguments

      public io.micronaut.core.type.Argument<?>[] getArguments()
      Specified by:
      getArguments in interface io.micronaut.inject.ExecutionHandle<T,R>
      Specified by:
      getArguments in interface io.micronaut.inject.MethodReference<T,R>
    • getReturnType

      public io.micronaut.core.type.ReturnType<R> getReturnType()
      Specified by:
      getReturnType in interface io.micronaut.inject.MethodReference<T,R>
    • invoke

      public R invoke(Object... arguments)
      Specified by:
      invoke in interface io.micronaut.inject.ExecutionHandle<T,R>
    • execute

      public R execute()
      Description copied from interface: RouteMatch
      Execute the route with the given values. Note if there are required arguments returned from RouteMatch.getRequiredArguments() this method will throw an IllegalArgumentException.
      Specified by:
      execute in interface RouteMatch<T>
      Returns:
      The result
    • fulfill

      public void fulfill(Map<String,Object> newValues)
      Description copied from interface: RouteMatch
      Fulfill argument values.
      Specified by:
      fulfill in interface RouteMatch<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: RouteMatch
      Attempt to satisfy the arguments of the given route with the data from the given request.
      Specified by:
      fulfillBeforeFilters in interface RouteMatch<T>
      Parameters:
      requestBinderRegistry - The request binder registry
      request - The request
    • fulfillAfterFilters

      public void fulfillAfterFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.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 interface RouteMatch<T>
      Parameters:
      requestBinderRegistry - The request binder registry
      request - The request