接口的使用
org.springframework.context.MessageSource
使用MessageSource的程序包 程序包 说明 org.springframework.context This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.org.springframework.context.annotation Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.org.springframework.context.support Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.org.springframework.jca.context Integration package that allows for deploying a Spring application context as a JCA 1.7 compliant RAR file.org.springframework.ui.context Contains classes defining the application context subinterface for UI applications.org.springframework.ui.context.support Classes supporting the org.springframework.ui.context package.org.springframework.validation.beanvalidation Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.org.springframework.web.context Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.org.springframework.web.context.support Classes supporting theorg.springframework.web.context
package, such as WebApplicationContext implementations and various utility classes.org.springframework.web.reactive.result.view Support for result handling through view resolution.org.springframework.web.servlet.mvc.annotation Support package for annotation-based Servlet MVC controllers.org.springframework.web.servlet.support Support classes for Spring's web MVC framework.org.springframework.web.servlet.tags This package contains Spring's JSP standard tag library for JSP 2.0+.org.springframework.web.servlet.view Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.org.springframework.context中MessageSource的使用
org.springframework.context中MessageSource的子接口 修饰符和类型 接口 说明 interface
ApplicationContext
Central interface to provide configuration for an application.interface
ConfigurableApplicationContext
SPI interface to be implemented by most if not all application contexts.interface
HierarchicalMessageSource
Sub-interface of MessageSource to be implemented by objects that can resolve messages hierarchically.返回MessageSource的org.springframework.context中的方法 修饰符和类型 方法 说明 MessageSource
HierarchicalMessageSource. getParentMessageSource()
Return the parent of this MessageSource, ornull
if none.参数类型为MessageSource的org.springframework.context中的方法 修饰符和类型 方法 说明 void
MessageSourceAware. setMessageSource(MessageSource messageSource)
Set the MessageSource that this object runs in.void
HierarchicalMessageSource. setParentMessageSource(MessageSource parent)
Set the parent that will be used to try to resolve messages that this object can't resolve.org.springframework.context.annotation中MessageSource的使用
实现MessageSource的org.springframework.context.annotation中的类 修饰符和类型 类 说明 class
AnnotationConfigApplicationContext
Standalone application context, accepting component classes as input — in particular@Configuration
-annotated classes, but also plain@Component
types and JSR-330 compliant classes usingjavax.inject
annotations.org.springframework.context.support中MessageSource的使用
实现MessageSource的org.springframework.context.support中的类 修饰符和类型 类 说明 class
AbstractApplicationContext
Abstract implementation of theApplicationContext
interface.class
AbstractMessageSource
Abstract implementation of theHierarchicalMessageSource
interface, implementing common handling of message variants, making it easy to implement a specific strategy for a concrete MessageSource.class
AbstractRefreshableApplicationContext
Base class forApplicationContext
implementations which are supposed to support multiple calls toAbstractApplicationContext.refresh()
, creating a new internal bean factory instance every time.class
AbstractRefreshableConfigApplicationContext
AbstractRefreshableApplicationContext
subclass that adds common handling of specified config locations.class
AbstractResourceBasedMessageSource
Abstract base class forMessageSource
implementations based on resource bundle conventions, such asResourceBundleMessageSource
andReloadableResourceBundleMessageSource
.class
AbstractXmlApplicationContext
Convenient base class forApplicationContext
implementations, drawing configuration from XML documents containing bean definitions understood by anXmlBeanDefinitionReader
.class
ClassPathXmlApplicationContext
Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g.class
DelegatingMessageSource
EmptyMessageSource
that delegates all calls to the parent MessageSource.class
FileSystemXmlApplicationContext
Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g.class
GenericApplicationContext
Generic ApplicationContext implementation that holds a single internalDefaultListableBeanFactory
instance and does not assume a specific bean definition format.class
GenericGroovyApplicationContext
AnApplicationContext
implementation that extendsGenericApplicationContext
and implementsGroovyObject
such that beans can be retrieved with the dot de-reference syntax instead of usingAbstractApplicationContext.getBean(java.lang.String)
.class
GenericXmlApplicationContext
Convenient application context with built-in XML support.class
ReloadableResourceBundleMessageSource
Spring-specificMessageSource
implementation that accesses resource bundles using specified basenames, participating in the SpringApplicationContext
's resource loading.class
ResourceBundleMessageSource
MessageSource
implementation that accesses resource bundles using specified basenames.class
StaticApplicationContext
ApplicationContext
implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources.class
StaticMessageSource
Simple implementation ofMessageSource
which allows messages to be registered programmatically.返回MessageSource的org.springframework.context.support中的方法 修饰符和类型 方法 说明 protected MessageSource
AbstractApplicationContext. getInternalParentMessageSource()
Return the internal message source of the parent context if it is an AbstractApplicationContext too; else, return the parent context itself.MessageSource
AbstractMessageSource. getParentMessageSource()
MessageSource
DelegatingMessageSource. getParentMessageSource()
参数类型为MessageSource的org.springframework.context.support中的方法 修饰符和类型 方法 说明 void
AbstractMessageSource. setParentMessageSource(MessageSource parent)
void
DelegatingMessageSource. setParentMessageSource(MessageSource parent)
参数类型为MessageSource的org.springframework.context.support中的构造器 构造器 说明 MessageSourceAccessor(MessageSource messageSource)
Create a new MessageSourceAccessor, using LocaleContextHolder's locale as default locale.MessageSourceAccessor(MessageSource messageSource, Locale defaultLocale)
Create a new MessageSourceAccessor, using the given default locale.MessageSourceResourceBundle(MessageSource source, Locale locale)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.MessageSourceResourceBundle(MessageSource source, Locale locale, ResourceBundle parent)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.org.springframework.jca.context中MessageSource的使用
实现MessageSource的org.springframework.jca.context中的类 修饰符和类型 类 说明 class
ResourceAdapterApplicationContext
ApplicationContext
implementation for a JCA ResourceAdapter.org.springframework.ui.context中MessageSource的使用
返回MessageSource的org.springframework.ui.context中的方法 修饰符和类型 方法 说明 MessageSource
Theme. getMessageSource()
Return the specific MessageSource that resolves messages with respect to this theme.org.springframework.ui.context.support中MessageSource的使用
返回MessageSource的org.springframework.ui.context.support中的方法 修饰符和类型 方法 说明 protected MessageSource
ResourceBundleThemeSource. createMessageSource(String basename)
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.MessageSource
SimpleTheme. getMessageSource()
参数类型为MessageSource的org.springframework.ui.context.support中的构造器 构造器 说明 SimpleTheme(String name, MessageSource messageSource)
Create a SimpleTheme.org.springframework.validation.beanvalidation中MessageSource的使用
参数类型为MessageSource的org.springframework.validation.beanvalidation中的方法 修饰符和类型 方法 说明 void
LocalValidatorFactoryBean. setValidationMessageSource(MessageSource messageSource)
Specify a custom Spring MessageSource for resolving validation messages, instead of relying on JSR-303's default "ValidationMessages.properties" bundle in the classpath.参数类型为MessageSource的org.springframework.validation.beanvalidation中的构造器 构造器 说明 MessageSourceResourceBundleLocator(MessageSource messageSource)
Build a MessageSourceResourceBundleLocator for the given MessageSource.org.springframework.web.context中MessageSource的使用
org.springframework.web.context中MessageSource的子接口 修饰符和类型 接口 说明 interface
ConfigurableWebApplicationContext
Interface to be implemented by configurable web application contexts.interface
WebApplicationContext
Interface to provide configuration for a web application.org.springframework.web.context.support中MessageSource的使用
实现MessageSource的org.springframework.web.context.support中的类 修饰符和类型 类 说明 class
AbstractRefreshableWebApplicationContext
AbstractRefreshableApplicationContext
subclass which implements theConfigurableWebApplicationContext
interface for web environments.class
AnnotationConfigWebApplicationContext
WebApplicationContext
implementation which accepts component classes as input — in particular@Configuration
-annotated classes, but also plain@Component
classes and JSR-330 compliant classes usingjavax.inject
annotations.class
GenericWebApplicationContext
Subclass ofGenericApplicationContext
, suitable for web environments.class
GroovyWebApplicationContext
WebApplicationContext
implementation which takes its configuration from Groovy bean definition scripts and/or XML files, as understood by aGroovyBeanDefinitionReader
.class
StaticWebApplicationContext
StaticWebApplicationContext
implementation for testing.class
XmlWebApplicationContext
WebApplicationContext
implementation which takes its configuration from XML documents, understood by anXmlBeanDefinitionReader
.org.springframework.web.reactive.result.view中MessageSource的使用
返回MessageSource的org.springframework.web.reactive.result.view中的方法 修饰符和类型 方法 说明 MessageSource
RequestContext. getMessageSource()
Return the MessageSource in use with this request.参数类型为MessageSource的org.springframework.web.reactive.result.view中的构造器 构造器 说明 RequestContext(ServerWebExchange exchange, Map<String,Object> model, MessageSource messageSource)
RequestContext(ServerWebExchange exchange, Map<String,Object> model, MessageSource messageSource, RequestDataValueProcessor dataValueProcessor)
org.springframework.web.servlet.mvc.annotation中MessageSource的使用
参数类型为MessageSource的org.springframework.web.servlet.mvc.annotation中的方法 修饰符和类型 方法 说明 void
ResponseStatusExceptionResolver. setMessageSource(MessageSource messageSource)
org.springframework.web.servlet.support中MessageSource的使用
返回MessageSource的org.springframework.web.servlet.support中的方法 修饰符和类型 方法 说明 static MessageSource
JstlUtils. getJstlAwareMessageSource(ServletContext servletContext, MessageSource messageSource)
Checks JSTL's "javax.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.MessageSource
RequestContext. getMessageSource()
Return the current WebApplicationContext as MessageSource.参数类型为MessageSource的org.springframework.web.servlet.support中的方法 修饰符和类型 方法 说明 static void
JstlUtils. exposeLocalizationContext(HttpServletRequest request, MessageSource messageSource)
Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.static MessageSource
JstlUtils. getJstlAwareMessageSource(ServletContext servletContext, MessageSource messageSource)
Checks JSTL's "javax.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.org.springframework.web.servlet.tags中MessageSource的使用
返回MessageSource的org.springframework.web.servlet.tags中的方法 修饰符和类型 方法 说明 protected MessageSource
MessageTag. getMessageSource()
Use the current RequestContext's application context as MessageSource.protected MessageSource
ThemeTag. getMessageSource()
Use the theme MessageSource for theme message resolution.org.springframework.web.servlet.view中MessageSource的使用
参数类型为MessageSource的org.springframework.web.servlet.view中的构造器 构造器 说明 JstlView(String url, MessageSource messageSource)
Create a new JstlView with the given URL.