# Uses of Interface
org.springframework.context.MessageSource

Packages that use MessageSource
Package
Description
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.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.

## Uses of MessageSource in org.springframework.context

Subinterfaces of MessageSource in org.springframework.context
Modifier and Type
Interface
Description
`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.
Methods in org.springframework.context that return MessageSource
Modifier and Type
Method
Description
`MessageSource`
HierarchicalMessageSource.`getParentMessageSource()`
Return the parent of this MessageSource, or `null` if none.
Methods in org.springframework.context with parameters of type MessageSource
Modifier and Type
Method
Description
`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.

## Uses of MessageSource in org.springframework.context.annotation

Classes in org.springframework.context.annotation that implement MessageSource
Modifier and Type
Class
Description
`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 using `jakarta.inject` annotations.

## Uses of MessageSource in org.springframework.context.support

Classes in org.springframework.context.support that implement MessageSource
Modifier and Type
Class
Description
`class`
`AbstractApplicationContext`
Abstract implementation of the `ApplicationContext` interface.
`class`
`AbstractMessageSource`
Abstract implementation of the `HierarchicalMessageSource` interface, implementing common handling of message variants, making it easy to implement a specific strategy for a concrete MessageSource.
`class`
`AbstractRefreshableApplicationContext`
Base class for `ApplicationContext` implementations which are supposed to support multiple calls to `AbstractApplicationContext.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 for `MessageSource` implementations based on resource bundle conventions, such as `ResourceBundleMessageSource` and `ReloadableResourceBundleMessageSource`.
`class`
`AbstractXmlApplicationContext`
Convenient base class for `ApplicationContext` implementations, drawing configuration from XML documents containing bean definitions understood by an `XmlBeanDefinitionReader`.
`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 (for example, "mypackage/myresource.txt").
`class`
`DelegatingMessageSource`
Empty `MessageSource` 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 (for example, "mydir/myfile.txt").
`class`
`GenericApplicationContext`
Generic ApplicationContext implementation that holds a single internal `DefaultListableBeanFactory` instance and does not assume a specific bean definition format.
`class`
`GenericGroovyApplicationContext`
An `ApplicationContext` implementation that extends `GenericApplicationContext` and implements `GroovyObject` such that beans can be retrieved with the dot de-reference syntax instead of using `AbstractApplicationContext.getBean(java.lang.String)`.
`class`
`GenericXmlApplicationContext`
Convenient application context with built-in XML support.
`class`
`ReloadableResourceBundleMessageSource`
Spring-specific `MessageSource` implementation that accesses resource bundles using specified basenames, participating in the Spring `ApplicationContext`'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 of `MessageSource` which allows messages to be registered programmatically.
Methods in org.springframework.context.support that return MessageSource
Modifier and Type
Method
Description
`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()`
Methods in org.springframework.context.support with parameters of type MessageSource
Modifier and Type
Method
Description
`void`
AbstractMessageSource.`setParentMessageSource(MessageSource parent)`
`void`
DelegatingMessageSource.`setParentMessageSource(MessageSource parent)`
Constructors in org.springframework.context.support with parameters of type MessageSource
Modifier
Constructor
Description
``
`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.

## Uses of MessageSource in org.springframework.ui.context

Methods in org.springframework.ui.context that return MessageSource
Modifier and Type
Method
Description
`MessageSource`
Theme.`getMessageSource()`
Deprecated.
Return the specific MessageSource that resolves messages with respect to this theme.

## Uses of MessageSource in org.springframework.ui.context.support

Methods in org.springframework.ui.context.support that return MessageSource
Modifier and Type
Method
Description
`protected MessageSource`
ResourceBundleThemeSource.`createMessageSource(String basename)`
Deprecated.
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.
`final MessageSource`
SimpleTheme.`getMessageSource()`
Deprecated.
Constructors in org.springframework.ui.context.support with parameters of type MessageSource
Modifier
Constructor
Description
``
`SimpleTheme(String name, MessageSource messageSource)`
Deprecated.
Create a SimpleTheme.

## Uses of MessageSource in org.springframework.validation.beanvalidation

Methods in org.springframework.validation.beanvalidation with parameters of type MessageSource
Modifier and Type
Method
Description
`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.
Constructors in org.springframework.validation.beanvalidation with parameters of type MessageSource
Modifier
Constructor
Description
``
`MessageSourceResourceBundleLocator(MessageSource messageSource)`
Build a MessageSourceResourceBundleLocator for the given MessageSource.