类 DefaultConversionService

java.lang.Object
cn.taketoday.core.conversion.support.GenericConversionService
cn.taketoday.core.conversion.support.DefaultConversionService
所有已实现的接口:
ConversionService, ConverterRegistry, ConfigurableConversionService

public class DefaultConversionService extends GenericConversionService
A specialization of 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.

从以下版本开始:
3.0
作者:
Chris Beams, Juergen Hoeller, Stephane Nicoll, Harry Yang
  • 字段详细资料

  • 构造器详细资料

    • DefaultConversionService

      public DefaultConversionService()
      Create a new DefaultConversionService with the set of default converters.
  • 方法详细资料

    • getSharedInstance

      public static DefaultConversionService getSharedInstance()
      Return a shared default ConversionService instance, lazily building it once needed.

      NOTE: We highly recommend constructing individual ConversionService instances for customization purposes. This accessor is only meant as a fallback for code paths which need simple type coercion but cannot access a longer-lived ConversionService instance any other way.

      返回:
      the shared ConversionService instance (never null)
    • addDefaultConverters

      public static void addDefaultConverters(ConverterRegistry converterRegistry)
      Add converters appropriate for most environments.
      参数:
      converterRegistry - 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 ConversionService
    • addCollectionConverters

      public static void addCollectionConverters(ConverterRegistry converterRegistry)
      Add common collection converters.
      参数:
      converterRegistry - 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 ConversionService
    • addScalarConverters

      private static void addScalarConverters(ConverterRegistry converterRegistry)