Class MvcNamespaceUtils
- java.lang.Object
- org.springframework.web.servlet.config.MvcNamespaceUtils
public abstract class MvcNamespaceUtils extends Object
Convenience methods for use in MVC namespace BeanDefinitionParsers.- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Brian Clozel
Constructor Summary
Constructors Constructor Description MvcNamespaceUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectgetContentNegotiationManager(ParserContext context)Find theContentNegotiationManagerbean created by or registered with theannotation-drivenelement.static RuntimeBeanReferenceregisterCorsConfigurations(Map<String,CorsConfiguration> corsConfigurations, ParserContext context, Object source)Registers aMap<String, CorsConfiguration>(mappedCorsConfigurations) under a well-known name unless already registered.static voidregisterDefaultComponents(ParserContext parserContext, Object source)static RuntimeBeanReferenceregisterPathMatcher(RuntimeBeanReference pathMatcherRef, ParserContext parserContext, Object source)Adds an alias to an existing well-known name or registers a new instance of aPathMatcherunder that well-known name, unless already registered.static RuntimeBeanReferenceregisterUrlPathHelper(RuntimeBeanReference urlPathHelperRef, ParserContext parserContext, Object source)Adds an alias to an existing well-known name or registers a new instance of aUrlPathHelperunder that well-known name, unless already registered.
Constructor Detail
MvcNamespaceUtils
public MvcNamespaceUtils()
Method Detail
registerDefaultComponents
public static void registerDefaultComponents(ParserContext parserContext, @Nullable Object source)
registerUrlPathHelper
public static RuntimeBeanReference registerUrlPathHelper(@Nullable RuntimeBeanReference urlPathHelperRef, ParserContext parserContext, @Nullable Object source)
Adds an alias to an existing well-known name or registers a new instance of aUrlPathHelperunder that well-known name, unless already registered.- Returns:
- a RuntimeBeanReference to this
UrlPathHelperinstance
registerPathMatcher
public static RuntimeBeanReference registerPathMatcher(@Nullable RuntimeBeanReference pathMatcherRef, ParserContext parserContext, @Nullable Object source)
Adds an alias to an existing well-known name or registers a new instance of aPathMatcherunder that well-known name, unless already registered.- Returns:
- a RuntimeBeanReference to this
PathMatcherinstance
registerCorsConfigurations
public static RuntimeBeanReference registerCorsConfigurations(@Nullable Map<String,CorsConfiguration> corsConfigurations, ParserContext context, @Nullable Object source)
Registers aMap<String, CorsConfiguration>(mappedCorsConfigurations) 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
@Nullable public static Object getContentNegotiationManager(ParserContext context)
Find theContentNegotiationManagerbean created by or registered with theannotation-drivenelement.- Returns:
- a bean definition, bean reference, or
nullif none defined