Class RequestMappingInfo.BuilderConfiguration
java.lang.Object
org.springframework.web.servlet.mvc.method.RequestMappingInfo.BuilderConfiguration
- Enclosing class:
RequestMappingInfo
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 -
Method Summary
Modifier and TypeMethodDescription@Nullable org.springframework.web.accept.ApiVersionStrategyReturn the configured strategy for API versioning.@Nullable org.springframework.web.accept.ContentNegotiationManagerReturn the ContentNegotiationManager to use for the ProducesRequestCondition, if any.@Nullable org.springframework.util.PathMatcherDeprecated, for removal: This API element is subject to removal in a future version.@Nullable org.springframework.web.util.pattern.PathPatternParser@Nullable org.springframework.web.util.pattern.PathPatternParserReturn thePathPatternParserto use, the one set explicitly or falling back on a default instance if bothPathPatternParserandPathMatcherare not set.@Nullable org.springframework.web.util.UrlPathHelperDeprecated.the path is resolved externally and obtained withServletRequestPathUtils.getCachedPathValue(ServletRequest); this method always returnsUrlPathHelper.defaultInstance.voidsetApiVersionStrategy(@Nullable org.springframework.web.accept.ApiVersionStrategy apiVersionStrategy) Set the strategy for API versioning.voidsetContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager) Set the ContentNegotiationManager to use for the ProducesRequestCondition.voidsetPathMatcher(@Nullable org.springframework.util.PathMatcher pathMatcher) Deprecated, for removal: This API element is subject to removal in a future version.use ofPathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.voidsetPatternParser(@Nullable org.springframework.web.util.pattern.PathPatternParser patternParser) Enable use of parsedPathPatterns as described inAbstractHandlerMapping.setPatternParser(PathPatternParser).voidsetUrlPathHelper(@Nullable org.springframework.web.util.UrlPathHelper urlPathHelper) Deprecated.the path is resolved externally and obtained withServletRequestPathUtils.getCachedPathValue(ServletRequest)
-
Constructor Details
-
BuilderConfiguration
public BuilderConfiguration()
-
-
Method Details
-
setPatternParser
public void setPatternParser(@Nullable org.springframework.web.util.pattern.PathPatternParser patternParser) Enable use of parsedPathPatterns as described inAbstractHandlerMapping.setPatternParser(PathPatternParser).Note: This property is mutually exclusive with
setPathMatcher(PathMatcher).By default, this is not set, but
RequestMappingInfo.Builderdefaults to usingPathPatternParserunlesssetPathMatcher(PathMatcher)is explicitly set.- Since:
- 5.3
-
getPatternParser
- 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 withServletRequestPathUtils.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 withServletRequestPathUtils.getCachedPathValue(ServletRequest); this method always returnsUrlPathHelper.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 ofPathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.Set a custom PathMatcher to use for the PatternsRequestCondition.By default, this is not set. You must set it explicitly if you want
PathMatcherto be used, or otherwiseRequestMappingInfodefaults to usingPathPatternParser. -
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 ofPathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.Return a custom PathMatcher to use for the PatternsRequestCondition, if any. -
getPatternParserToUse
Return thePathPatternParserto use, the one set explicitly or falling back on a default instance if bothPathPatternParserandPathMatcherare 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
Return the configured strategy for API versioning.- Since:
- 7.0
-
PathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.