Class RequestMappingInfo.BuilderConfiguration

java.lang.Object
org.springframework.web.servlet.mvc.method.RequestMappingInfo.BuilderConfiguration
Enclosing class:
RequestMappingInfo

public static class RequestMappingInfo.BuilderConfiguration extends Object
Container for configuration options used for request mapping purposes. Such configuration is required to create RequestMappingInfo instances but is typically used across all RequestMappingInfo instances.
Since:
4.2
See Also:
  • Constructor Details

    • BuilderConfiguration

      public BuilderConfiguration()
  • Method Details

    • setPatternParser

      public void setPatternParser(@Nullable org.springframework.web.util.pattern.PathPatternParser patternParser)
      Enable use of parsed PathPatterns as described in AbstractHandlerMapping.setPatternParser(PathPatternParser).

      Note: This property is mutually exclusive with setPathMatcher(PathMatcher).

      By default this is not set, but RequestMappingInfo.Builder defaults to using PathPatternParser unless setPathMatcher(PathMatcher) is explicitly set.

      Since:
      5.3
    • getPatternParser

      @Nullable public org.springframework.web.util.pattern.PathPatternParser getPatternParser()
      Return the configured PathPatternParser, or null.
      Since:
      5.3
    • setUrlPathHelper

      @Deprecated public void setUrlPathHelper(@Nullable org.springframework.web.util.UrlPathHelper urlPathHelper)
      Deprecated.
      as of 5.3, the path is resolved externally and obtained with ServletRequestPathUtils.getCachedPathValue(ServletRequest)
      Set a custom UrlPathHelper to use for the PatternsRequestCondition.

      By default this is not set.

      Since:
      4.2.8
    • getUrlPathHelper

      @Nullable @Deprecated public org.springframework.web.util.UrlPathHelper getUrlPathHelper()
      Deprecated.
      as of 5.3, the path is resolved externally and obtained with ServletRequestPathUtils.getCachedPathValue(ServletRequest); this method always returns UrlPathHelper.defaultInstance.
      Return the configured UrlPathHelper.
    • setPathMatcher

      public void setPathMatcher(@Nullable org.springframework.util.PathMatcher pathMatcher)
      Set a custom PathMatcher to use for the PatternsRequestCondition.

      By default this is not set. You must set it explicitly if you want PathMatcher to be used, or otherwise RequestMappingInfo defaults to using PathPatternParser.

    • getPathMatcher

      @Nullable public org.springframework.util.PathMatcher getPathMatcher()
      Return a custom PathMatcher to use for the PatternsRequestCondition, if any.
    • getPatternParserToUse

      @Nullable public org.springframework.web.util.pattern.PathPatternParser getPatternParserToUse()
      Return the PathPatternParser to use, the one set explicitly or falling back on a default instance if both PathPatternParser and PathMatcher are not set.
      Since:
      6.1.2
    • setTrailingSlashMatch

      @Deprecated(since="6.0") public void setTrailingSlashMatch(boolean trailingSlashMatch)
      Deprecated.
      as of 6.0, see PathPatternParser.setMatchOptionalTrailingSeparator(boolean)
      Set whether to apply trailing slash matching in PatternsRequestCondition.

      The default was changed in 6.0 from true to false in order to support the deprecation of the property.

    • useTrailingSlashMatch

      @Deprecated(since="6.0") public boolean useTrailingSlashMatch()
      Deprecated.
      as of 6.0 together with setTrailingSlashMatch(boolean)
      Return whether to apply trailing slash matching in PatternsRequestCondition.
    • setSuffixPatternMatch

      @Deprecated public void setSuffixPatternMatch(boolean suffixPatternMatch)
      Deprecated.
      Set whether to apply suffix pattern matching in PatternsRequestCondition.

      By default this is set to 'false'.

      See Also:
    • useSuffixPatternMatch

      @Deprecated public boolean useSuffixPatternMatch()
      Deprecated.
      Return whether to apply suffix pattern matching in PatternsRequestCondition.
    • setRegisteredSuffixPatternMatch

      @Deprecated public void setRegisteredSuffixPatternMatch(boolean registeredSuffixPatternMatch)
      Deprecated.
      as of 5.2.4. See class-level note in RequestMappingHandlerMapping on the deprecation of path extension config options.
      Set whether suffix pattern matching should be restricted to registered file extensions only. Setting this property also sets suffixPatternMatch=true and requires that a setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager) is also configured in order to obtain the registered file extensions.
    • useRegisteredSuffixPatternMatch

      @Deprecated public boolean useRegisteredSuffixPatternMatch()
      Deprecated.
      as of 5.2.4. See class-level note in RequestMappingHandlerMapping on the deprecation of path extension config options.
      Return whether suffix pattern matching should be restricted to registered file extensions only.
    • getFileExtensions

      @Nullable @Deprecated public List<String> getFileExtensions()
      Deprecated.
      as of 5.2.4. See class-level note in RequestMappingHandlerMapping on the deprecation of path extension config options.
      Return the file extensions to use for suffix pattern matching. If registeredSuffixPatternMatch=true, the extensions are obtained from the configured contentNegotiationManager.
    • setContentNegotiationManager

      public void setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)
      Set the ContentNegotiationManager to use for the ProducesRequestCondition.

      By default this is not set.

    • getContentNegotiationManager

      @Nullable public org.springframework.web.accept.ContentNegotiationManager getContentNegotiationManager()
      Return the ContentNegotiationManager to use for the ProducesRequestCondition, if any.