Class MvcNamespaceUtils
java.lang.Object
org.springframework.web.servlet.config.MvcNamespaceUtils
Convenience methods for use in MVC namespace BeanDefinitionParsers.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Juergen Hoeller, Brian Clozel, Marten Deinum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
Find theContentNegotiationManager
bean created by or registered with theannotation-driven
element.static RuntimeBeanReference
registerCorsConfigurations
(Map<String, CorsConfiguration> corsConfigurations, ParserContext context, Object source) Registers aMap<String, CorsConfiguration>
(mappedCorsConfiguration
s) under a well-known name unless already registered.static void
registerDefaultComponents
(ParserContext context, Object source) static RuntimeBeanReference
registerPathMatcher
(RuntimeBeanReference pathMatcherRef, ParserContext context, Object source) Adds an alias to an existing well-known name or registers a new instance of aPathMatcher
under that well-known name, unless already registered.static RuntimeBeanReference
registerPatternParser
(RuntimeBeanReference patternParserRef, ParserContext context, Object source) Adds an alias to an existing well-known name or registers a new instance of aPathPatternParser
under that well-known name, unless already registered.static RuntimeBeanReference
registerUrlPathHelper
(RuntimeBeanReference urlPathHelperRef, ParserContext context, Object source) Adds an alias to an existing well-known name or registers a new instance of aUrlPathHelper
under that well-known name, unless already registered.
-
Constructor Details
-
MvcNamespaceUtils
public MvcNamespaceUtils()
-
-
Method Details
-
registerDefaultComponents
-
registerUrlPathHelper
public static RuntimeBeanReference registerUrlPathHelper(@Nullable RuntimeBeanReference urlPathHelperRef, ParserContext context, @Nullable Object source) Adds an alias to an existing well-known name or registers a new instance of aUrlPathHelper
under that well-known name, unless already registered.- Returns:
- a RuntimeBeanReference to this
UrlPathHelper
instance
-
registerPathMatcher
public static RuntimeBeanReference registerPathMatcher(@Nullable RuntimeBeanReference pathMatcherRef, ParserContext context, @Nullable Object source) Adds an alias to an existing well-known name or registers a new instance of aPathMatcher
under that well-known name, unless already registered.- Returns:
- a RuntimeBeanReference to this
PathMatcher
instance
-
registerPatternParser
public static RuntimeBeanReference registerPatternParser(@Nullable RuntimeBeanReference patternParserRef, ParserContext context, @Nullable Object source) Adds an alias to an existing well-known name or registers a new instance of aPathPatternParser
under that well-known name, unless already registered.- Returns:
- a RuntimeBeanReference to this
PathPatternParser
instance
-
registerCorsConfigurations
public static RuntimeBeanReference registerCorsConfigurations(@Nullable Map<String, CorsConfiguration> corsConfigurations, ParserContext context, @Nullable Object source) Registers aMap<String, CorsConfiguration>
(mappedCorsConfiguration
s) under a well-known name unless already registered. The bean definition may be updated if a non-null CORS configuration is provided.- Returns:
- a RuntimeBeanReference to this
Map<String, CorsConfiguration>
instance
-
getContentNegotiationManager
Find theContentNegotiationManager
bean created by or registered with theannotation-driven
element.- Returns:
- a bean definition, bean reference, or
null
if none defined
-