spring-framework / org.springframework.context / EmbeddedValueResolverAware

EmbeddedValueResolverAware

interface EmbeddedValueResolverAware : Aware

Interface to be implemented by any object that wishes to be notified of a StringValueResolver for the resolution of embedded definition values.

This is an alternative to a full ConfigurableBeanFactory dependency via the ApplicationContextAware/BeanFactoryAware interfaces.

Author
Juergen Hoeller

Author
Chris Beams

Since
3.0.3

See Also
org.springframework.beans.factory.config.ConfigurableBeanFactory#resolveEmbeddedValue(String)org.springframework.beans.factory.config.ConfigurableBeanFactory#getBeanExpressionResolver()org.springframework.beans.factory.config.EmbeddedValueResolver

Functions

setEmbeddedValueResolver

abstract fun setEmbeddedValueResolver(resolver: StringValueResolver): Unit

Set the StringValueResolver to use for resolving embedded definition values.

Inheritors

EmbeddedValueResolutionSupport

open class EmbeddedValueResolutionSupport : EmbeddedValueResolverAware

Convenient base class for components with a need for embedded value resolution (i.e. org.springframework.context.EmbeddedValueResolverAware consumers).

FormattingConversionService

open class FormattingConversionService : GenericConversionService, FormatterRegistry, EmbeddedValueResolverAware

A org.springframework.core.convert.ConversionService implementation designed to be configured as a FormatterRegistry.

FormattingConversionServiceFactoryBean

open class FormattingConversionServiceFactoryBean : FactoryBean<FormattingConversionService>, EmbeddedValueResolverAware, InitializingBean

A factory providing convenient access to a FormattingConversionService configured with converters and formatters for common types such as numbers and datetimes.

Additional converters and formatters can be registered declaratively through #setConverters(Set) and #setFormatters(Set). Another option is to register converters and formatters in code by implementing the FormatterRegistrar interface. You can then configure provide the set of registrars to use through #setFormatterRegistrars(Set).

A good example for registering converters and formatters in code is JodaTimeFormatterRegistrar, which registers a number of date-related formatters and converters. For a more detailed list of cases see #setFormatterRegistrars(Set)

Like all FactoryBean implementations, this class is suitable for use when configuring a Spring application context using Spring <beans> XML. When configuring the container with org.springframework.context.annotation.Configuration classes, simply instantiate, configure and return the appropriate FormattingConversionService object from a org.springframework.context.annotation.Bean method.