类 MvcNamespaceUtils
- java.lang.Object
- org.springframework.web.servlet.config.MvcNamespaceUtils
public abstract class MvcNamespaceUtils extends Object
Convenience methods for use in MVC namespace BeanDefinitionParsers.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev, Brian Clozel
构造器概要
构造器 构造器 说明 MvcNamespaceUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 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.
构造器详细资料
MvcNamespaceUtils
public MvcNamespaceUtils()
方法详细资料
registerDefaultComponents
public static void registerDefaultComponents(ParserContext parserContext, Object source)
registerUrlPathHelper
public static RuntimeBeanReference registerUrlPathHelper(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.- 返回:
- a RuntimeBeanReference to this
UrlPathHelperinstance
registerPathMatcher
public static RuntimeBeanReference registerPathMatcher(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.- 返回:
- a RuntimeBeanReference to this
PathMatcherinstance
registerCorsConfigurations
public static RuntimeBeanReference registerCorsConfigurations(Map<String,CorsConfiguration> corsConfigurations, ParserContext context, 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.- 返回:
- a RuntimeBeanReference to this
Map<String, CorsConfiguration>instance
getContentNegotiationManager
public static Object getContentNegotiationManager(ParserContext context)
Find theContentNegotiationManagerbean created by or registered with theannotation-drivenelement.- 返回:
- a bean definition, bean reference, or
nullif none defined