类 StandardTypeConverter

java.lang.Object
cn.taketoday.expression.spel.support.StandardTypeConverter
所有已实现的接口:
TypeConverter

public class StandardTypeConverter extends Object implements TypeConverter
Default implementation of the TypeConverter interface, delegating to a core ConversionService.
从以下版本开始:
4.0
作者:
Juergen Hoeller, Andy Clement, Harry Yang
另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • StandardTypeConverter

      public StandardTypeConverter()
      Create a StandardTypeConverter for the default ConversionService.
      另请参阅:
    • StandardTypeConverter

      public StandardTypeConverter(ConversionService conversionService)
      Create a StandardTypeConverter for the given ConversionService.
      参数:
      conversionService - the ConversionService to delegate to
    • StandardTypeConverter

      public StandardTypeConverter(Supplier<ConversionService> conversionService)
      Create a StandardTypeConverter for the given ConversionService.
      参数:
      conversionService - a Supplier for the ConversionService to delegate to
  • 方法详细资料

    • canConvert

      public boolean canConvert(@Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
      从接口复制的说明: TypeConverter
      Return true if the type converter can convert the specified type to the desired target type.
      指定者:
      canConvert 在接口中 TypeConverter
      参数:
      sourceType - a type descriptor that describes the source type
      targetType - a type descriptor that describes the requested result type
      返回:
      true if that conversion can be performed
    • convertValue

      @Nullable public Object convertValue(@Nullable Object value, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
      从接口复制的说明: TypeConverter
      Convert (or coerce) a value from one type to another, for example from a boolean to a String.

      The TypeDescriptor parameters enable support for typed collections: A caller may prefer a List<Integer>, for example, rather than simply any List.

      指定者:
      convertValue 在接口中 TypeConverter
      参数:
      value - the value to be converted
      sourceType - a type descriptor that supplies extra information about the source object
      targetType - a type descriptor that supplies extra information about the requested result type
      返回:
      the converted value