public class ApplicationConversionService extends FormattingConversionService
FormattingConversionService
configured by default with
converters and formatters appropriate for most Spring Boot applications.
Designed for direct instantiation but also exposes the static
addApplicationConverters(org.springframework.core.convert.converter.ConverterRegistry)
and
addApplicationFormatters(FormatterRegistry)
utility methods for ad-hoc use
against registry instance.
Constructor and Description |
---|
ApplicationConversionService() |
ApplicationConversionService(StringValueResolver embeddedValueResolver) |
Modifier and Type | Method and Description |
---|---|
static void |
addApplicationConverters(ConverterRegistry registry)
Add converters useful for most Spring Boot applications.
|
static void |
addApplicationFormatters(FormatterRegistry registry)
Add formatters useful for most Spring Boot applications.
|
static void |
addDelimitedStringConverters(ConverterRegistry registry)
Add converters to support delimited strings.
|
static void |
configure(FormatterRegistry registry)
Configure the given
FormatterRegistry with formatters and converters
appropriate for most Spring Boot applications. |
static ConversionService |
getSharedInstance()
Return a shared default application
ConversionService instance, lazily
building it once needed. |
addFormatter, addFormatterForFieldAnnotation, addFormatterForFieldType, addFormatterForFieldType, setEmbeddedValueResolver
addConverter, addConverter, addConverter, addConverterFactory, canBypassConvert, canConvert, canConvert, convert, convert, convert, convertNullSource, getConverter, getDefaultConverter, removeConvertible, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addConverter, addConverter, addConverter, addConverterFactory, removeConvertible
public ApplicationConversionService()
public ApplicationConversionService(StringValueResolver embeddedValueResolver)
public static ConversionService getSharedInstance()
ConversionService
instance, lazily
building it once needed.
Note: This method actually returns an ApplicationConversionService
instance. However, the ConversionService
signature has been preserved for
binary compatibility.
ApplicationConversionService
instance (never
null
)public static void configure(FormatterRegistry registry)
FormatterRegistry
with formatters and converters
appropriate for most Spring Boot applications.registry
- the registry of converters to add to (must also be castable to
ConversionService, e.g. being a ConfigurableConversionService
)ClassCastException
- if the given FormatterRegistry could not be cast to a
ConversionServicepublic static void addApplicationConverters(ConverterRegistry registry)
registry
- the registry of converters to add to (must also be castable to
ConversionService, e.g. being a ConfigurableConversionService
)ClassCastException
- if the given ConverterRegistry could not be cast to a
ConversionServicepublic static void addDelimitedStringConverters(ConverterRegistry registry)
registry
- the registry of converters to add to (must also be castable to
ConversionService, e.g. being a ConfigurableConversionService
)ClassCastException
- if the given ConverterRegistry could not be cast to a
ConversionServicepublic static void addApplicationFormatters(FormatterRegistry registry)
registry
- the service to register default formatters withCopyright © 2018 Pivotal Software, Inc.. All rights reserved.