Interface FilterRoute

All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.http.filter.HttpFilterResolver.FilterEntry

public interface FilterRoute extends io.micronaut.http.filter.HttpFilterResolver.FilterEntry
A filter route is a route that matches an HttpFilter.
Since:
1.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable String
    Returns the matching annotation.
    @NonNull io.micronaut.http.filter.GenericHttpFilter
     
    default boolean
    If it's a pre-matching filter, the one being executed before the route is resolved.
    Optional<io.micronaut.http.filter.GenericHttpFilter>
    match(io.micronaut.http.HttpMethod method, String path)
    Matches the given path to this filter route.
    Optional<io.micronaut.http.filter.GenericHttpFilter>
    match(io.micronaut.http.HttpMethod method, URI uri)
    Deprecated, for removal: This API element is subject to removal in a future version.
    methods(io.micronaut.http.HttpMethod... methods)
    Restrict the methods this filter route matches.
    pattern(String pattern)
    Add an addition pattern to this filter route.
    patternStyle(io.micronaut.http.filter.FilterPatternStyle patternStyle)
    Sets the pattern style that this filter route matches.

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

    getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared

    Methods inherited from interface io.micronaut.http.filter.HttpFilterResolver.FilterEntry

    getFilterMethods, getPatterns, getPatternStyle, hasMethods, hasPatterns
  • Method Details

    • isPreMatching

      default boolean isPreMatching()
      If it's a pre-matching filter, the one being executed before the route is resolved.
      Returns:
      true if pre-matching
      Since:
      4.6
    • findMatchingAnnotation

      @Nullable default @Nullable String findMatchingAnnotation()
      Returns the matching annotation. See FilterMatcher.
      Returns:
      The matching annotation or null
      Since:
      4.6
    • getFilter

      @NonNull @NonNull io.micronaut.http.filter.GenericHttpFilter getFilter()
      Specified by:
      getFilter in interface io.micronaut.http.filter.HttpFilterResolver.FilterEntry
      Returns:
      The filter for this FilterRoute
    • match

      @Deprecated(forRemoval=true, since="4.3.0") Optional<io.micronaut.http.filter.GenericHttpFilter> match(io.micronaut.http.HttpMethod method, URI uri)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Matches the given path to this filter route.
      Parameters:
      method - The HTTP method
      uri - The URI
      Returns:
      An Optional of HttpFilter
    • match

      Optional<io.micronaut.http.filter.GenericHttpFilter> match(io.micronaut.http.HttpMethod method, String path)
      Matches the given path to this filter route.
      Parameters:
      method - The HTTP method
      path - The path
      Returns:
      An Optional of HttpFilter
      Since:
      4.3.0
    • pattern

      FilterRoute pattern(String pattern)
      Add an addition pattern to this filter route.
      Parameters:
      pattern - The pattern
      Returns:
      This route
    • methods

      FilterRoute methods(io.micronaut.http.HttpMethod... methods)
      Restrict the methods this filter route matches.
      Parameters:
      methods - The methods
      Returns:
      This route
    • patternStyle

      FilterRoute patternStyle(io.micronaut.http.filter.FilterPatternStyle patternStyle)
      Sets the pattern style that this filter route matches.
      Parameters:
      patternStyle - The pattern style
      Returns:
      This route