public class DefaultFormattingConversionService extends FormattingConversionService
FormattingConversionService
configured by default with
converters and formatters appropriate for most applications.
Designed for direct instantiation but also exposes the static addDefaultFormatters(org.springframework.format.FormatterRegistry)
utility method for ad hoc use against any FormatterRegistry
instance, just
as DefaultConversionService
exposes its own
addDefaultConverters
method.
Constructor and Description |
---|
DefaultFormattingConversionService()
Create a new
DefaultFormattingConversionService with the set of
default converters and
default formatters. |
DefaultFormattingConversionService(boolean registerDefaultFormatters)
Create a new
DefaultFormattingConversionService with the set of
default converters and,
based on the value of registerDefaultFormatters , the set of
default formatters. |
DefaultFormattingConversionService(StringValueResolver embeddedValueResolver,
boolean registerDefaultFormatters)
Create a new
DefaultFormattingConversionService with the set of
default converters and,
based on the value of registerDefaultFormatters , the set of
default formatters |
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultFormatters(FormatterRegistry formatterRegistry)
Add formatters appropriate for most environments, including number formatters and a Joda-Time
date formatter if Joda-Time is present on the classpath.
|
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 DefaultFormattingConversionService()
DefaultFormattingConversionService
with the set of
default converters and
default formatters.public DefaultFormattingConversionService(boolean registerDefaultFormatters)
DefaultFormattingConversionService
with the set of
default converters and,
based on the value of registerDefaultFormatters
, the set of
default formatters.registerDefaultFormatters
- whether to register default formatterspublic DefaultFormattingConversionService(StringValueResolver embeddedValueResolver, boolean registerDefaultFormatters)
DefaultFormattingConversionService
with the set of
default converters and,
based on the value of registerDefaultFormatters
, the set of
default formattersembeddedValueResolver
- delegated to FormattingConversionService.setEmbeddedValueResolver(StringValueResolver)
prior to calling addDefaultFormatters(org.springframework.format.FormatterRegistry)
.registerDefaultFormatters
- whether to register default formatterspublic static void addDefaultFormatters(FormatterRegistry formatterRegistry)
formatterRegistry
- the service to register default formatters against