类 StandardTypeConverter
java.lang.Object
cn.taketoday.expression.spel.support.StandardTypeConverter
- 所有已实现的接口:
TypeConverter
Default implementation of the
TypeConverter interface,
delegating to a core ConversionService.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Andy Clement
- 另请参阅:
-
构造器概要
构造器构造器说明Create a StandardTypeConverter for the default ConversionService.StandardTypeConverter(ConversionService conversionService) Create a StandardTypeConverter for the given ConversionService.StandardTypeConverter(Supplier<ConversionService> conversionService) Create a StandardTypeConverter for the given ConversionService. -
方法概要
修饰符和类型方法说明booleancanConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Returntrueif the type converter can convert the specified type to the desired target type.convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) Convert (or coerce) a value from one type to another, for example from abooleanto aString.
-
构造器详细资料
-
StandardTypeConverter
public StandardTypeConverter()Create a StandardTypeConverter for the default ConversionService. -
StandardTypeConverter
Create a StandardTypeConverter for the given ConversionService.- 参数:
conversionService- the ConversionService to delegate to
-
StandardTypeConverter
Create a StandardTypeConverter for the given ConversionService.- 参数:
conversionService- a Supplier for the ConversionService to delegate to
-
-
方法详细资料
-
canConvert
从接口复制的说明:TypeConverterReturntrueif the type converter can convert the specified type to the desired target type.- 指定者:
canConvert在接口中TypeConverter- 参数:
sourceType- a type descriptor that describes the source typetargetType- a type descriptor that describes the requested result type- 返回:
trueif that conversion can be performed
-
convertValue
@Nullable public Object convertValue(@Nullable Object value, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType) 从接口复制的说明:TypeConverterConvert (or coerce) a value from one type to another, for example from abooleanto aString.The
TypeDescriptorparameters enable support for typed collections: A caller may prefer aList<Integer>, for example, rather than simply anyList.- 指定者:
convertValue在接口中TypeConverter- 参数:
value- the value to be convertedsourceType- a type descriptor that supplies extra information about the source objecttargetType- a type descriptor that supplies extra information about the requested result type- 返回:
- the converted value
-