ApplicationConversionService

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

Designed for direct instantiation but also exposes the static addApplicationConverters and addApplicationFormatters utility methods for ad-hoc use against registry instance.

Author

Phillip Webb

Since

2.0.0

Constructors

Link copied to clipboard
constructor()
constructor(embeddedValueResolver: StringValueResolver)

Functions

Link copied to clipboard
Add converters useful for most Spring Boot applications.
Link copied to clipboard
Add formatters useful for most Spring Boot applications.
Link copied to clipboard
open fun addBeans(registry: FormatterRegistry, beanFactory: ListableBeanFactory)
Add GenericConverter, Converter, Printer, Parser and Formatter beans from the specified context.
Link copied to clipboard
open fun addConverter(converter: Converter<out Any, out Any>)
open fun addConverter(converter: GenericConverter)
open fun <S, T> addConverter(sourceType: Class<S>, targetType: Class<T>, converter: Converter<in S, out T>)
Link copied to clipboard
open fun addConverterFactory(factory: ConverterFactory<out Any, out Any>)
Link copied to clipboard
Add converters to support delimited strings.
Link copied to clipboard
open fun addFormatter(formatter: Formatter<out Any>)
Link copied to clipboard
open fun addFormatterForFieldAnnotation(annotationFormatterFactory: AnnotationFormatterFactory<out Annotation>)
Link copied to clipboard
open fun addFormatterForFieldType(fieldType: Class<out Any>, formatter: Formatter<out Any>)
open fun addFormatterForFieldType(fieldType: Class<out Any>, printer: Printer<out Any>, parser: Parser<out Any>)
Link copied to clipboard
open fun addParser(parser: Parser<out Any>)
Link copied to clipboard
open fun addPrinter(printer: Printer<out Any>)
Link copied to clipboard
open fun canBypassConvert(sourceType: TypeDescriptor, targetType: TypeDescriptor): Boolean
Link copied to clipboard
open fun canConvert(sourceType: Class<out Any>, targetType: Class<out Any>): Boolean
Link copied to clipboard
open fun configure(registry: FormatterRegistry)
Configure the given FormatterRegistry with formatters and converters appropriate for most Spring Boot applications.
Link copied to clipboard
open fun <T> convert(source: Any, targetType: Class<T>): T
open fun convert(source: Any, sourceType: TypeDescriptor, targetType: TypeDescriptor): Any
Link copied to clipboard
Return a shared default application ConversionService instance, lazily building it once needed.
Link copied to clipboard
Return true if objects of sourceType can be converted to the targetType and the converter has Object.class as a supported source type.
Link copied to clipboard
open fun removeConvertible(sourceType: Class<out Any>, targetType: Class<out Any>)
Link copied to clipboard
Link copied to clipboard
open fun toString(): String