public class DefaultConversionService extends GenericConversionService
GenericConversionService
configured by default with
converters appropriate for most environments.
Designed for direct instantiation but also exposes the static
addDefaultConverters(ConverterRegistry)
utility method for ad hoc use against any
ConverterRegistry
instance.
Modifier and Type | Class and Description |
---|---|
private static class |
DefaultConversionService.Jsr310ConverterRegistrar
Inner class to avoid a hard-coded dependency on Java 8's
java.time package. |
Modifier and Type | Field and Description |
---|---|
private static boolean |
jsr310Available
Java 8's java.time package available?
|
Constructor and Description |
---|
DefaultConversionService()
Create a new
DefaultConversionService with the set of
default converters. |
Modifier and Type | Method and Description |
---|---|
private static void |
addCollectionConverters(ConverterRegistry converterRegistry) |
static void |
addDefaultConverters(ConverterRegistry converterRegistry)
Add converters appropriate for most environments.
|
private static void |
addScalarConverters(ConverterRegistry converterRegistry) |
addConverter, addConverter, addConverter, addConverterFactory, canBypassConvert, canConvert, canConvert, convert, convert, convert, convertNullSource, getConverter, getDefaultConverter, removeConvertible, toString
private static final boolean jsr310Available
public DefaultConversionService()
DefaultConversionService
with the set of
default converters.public static void addDefaultConverters(ConverterRegistry converterRegistry)
converterRegistry
- the registry of converters to add to (must also be castable to ConversionService,
e.g. being a ConfigurableConversionService
)java.lang.ClassCastException
- if the given ConverterRegistry could not be cast to a ConversionServiceprivate static void addScalarConverters(ConverterRegistry converterRegistry)
private static void addCollectionConverters(ConverterRegistry converterRegistry)