spring-framework / org.springframework.format.support / FormattingConversionService

FormattingConversionService

open class FormattingConversionService : GenericConversionService, FormatterRegistry, EmbeddedValueResolverAware

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

Author
Keith Donald

Author
Juergen Hoeller

Since
3.0

Constructors

<init>

FormattingConversionService()

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

Functions

addFormatter

open fun addFormatter(formatter: Formatter<*>): Unit

addFormatterForFieldAnnotation

open fun addFormatterForFieldAnnotation(annotationFormatterFactory: AnnotationFormatterFactory<out Annotation>): Unit

addFormatterForFieldType

open fun addFormatterForFieldType(fieldType: Class<*>, formatter: Formatter<*>): Unit
open fun addFormatterForFieldType(fieldType: Class<*>, printer: Printer<*>, parser: Parser<*>): Unit

setEmbeddedValueResolver

open fun setEmbeddedValueResolver(resolver: StringValueResolver): Unit

Inheritors

DefaultFormattingConversionService

open class DefaultFormattingConversionService : FormattingConversionService

A specialization of FormattingConversionService configured by default with converters and formatters appropriate for most applications.

Designed for direct instantiation but also exposes the static #addDefaultFormatters utility method for ad hoc use against any FormatterRegistry instance, just as DefaultConversionService exposes its own addDefaultConverters method.

Automatically registers formatters for JSR-354 Money & Currency, JSR-310 Date-Time and/or Joda-Time, depending on the presence of the corresponding API on the classpath.