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
Author:
Arjen Poutsma, Rossen Stoyanchev
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.springframework.web.accept.ApiVersionStrategy
    Return the configured strategy for API versioning.
    @Nullable org.springframework.web.accept.ContentNegotiationManager
    Return the ContentNegotiationManager to use for the ProducesRequestCondition, if any.
    @Nullable org.springframework.util.PathMatcher
    Deprecated, for removal: This API element is subject to removal in a future version.
    use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.
    @Nullable org.springframework.web.util.pattern.PathPatternParser
    Return the configured PathPatternParser, or null.
    @Nullable org.springframework.web.util.pattern.PathPatternParser
    Return the PathPatternParser to use, the one set explicitly or falling back on a default instance if both PathPatternParser and PathMatcher are not set.
    @Nullable org.springframework.web.util.UrlPathHelper
    Deprecated.
    the path is resolved externally and obtained with ServletRequestPathUtils.getCachedPathValue(ServletRequest); this method always returns UrlPathHelper.defaultInstance.
    void
    setApiVersionStrategy(@Nullable org.springframework.web.accept.ApiVersionStrategy apiVersionStrategy)
    Set the strategy for API versioning.
    void
    setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)
    Set the ContentNegotiationManager to use for the ProducesRequestCondition.
    void
    setPathMatcher(@Nullable org.springframework.util.PathMatcher pathMatcher)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.
    void
    setPatternParser(@Nullable org.springframework.web.util.pattern.PathPatternParser patternParser)
    Enable use of parsed PathPatterns as described in AbstractHandlerMapping.setPatternParser(PathPatternParser).
    void
    setUrlPathHelper(@Nullable org.springframework.web.util.UrlPathHelper urlPathHelper)
    Deprecated.
    the path is resolved externally and obtained with ServletRequestPathUtils.getCachedPathValue(ServletRequest)

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

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

      @Deprecated(since="5.3") public void setUrlPathHelper(@Nullable org.springframework.web.util.UrlPathHelper urlPathHelper)
      Deprecated.
      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

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

      @Deprecated(since="7.0", forRemoval=true) public void setPathMatcher(@Nullable org.springframework.util.PathMatcher pathMatcher)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.
      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

      @Deprecated(since="7.0", forRemoval=true) public @Nullable org.springframework.util.PathMatcher getPathMatcher()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.
      Return a custom PathMatcher to use for the PatternsRequestCondition, if any.
    • getPatternParserToUse

      public @Nullable 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
    • 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

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

      public void setApiVersionStrategy(@Nullable org.springframework.web.accept.ApiVersionStrategy apiVersionStrategy)
      Set the strategy for API versioning.
      Parameters:
      apiVersionStrategy - the strategy to use
      Since:
      7.0
    • getApiVersionStrategy

      public @Nullable org.springframework.web.accept.ApiVersionStrategy getApiVersionStrategy()
      Return the configured strategy for API versioning.
      Since:
      7.0