public class StandardTypeConverter extends ObjectSE implements TypeConverter
ConversionService
に委譲する、TypeConverter
インターフェースのデフォルト実装。ConversionService
コンストラクターと説明 |
---|
StandardTypeConverter() デフォルトの ConversionService 用に StandardTypeConverter を作成します。 |
StandardTypeConverter(ConversionService conversionService) 指定された ConversionService の StandardTypeConverter を作成します。 |
StandardTypeConverter(SupplierSE<ConversionService> conversionService) 指定された ConversionService の StandardTypeConverter を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
boolean | canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) 型コンバーターが指定された型を目的のターゲット型に変換できる場合は、 true を返します。 |
ObjectSE | convertValue(ObjectSE value, TypeDescriptor sourceType, TypeDescriptor targetType) 値をある型から別の型に変換(強制)します。たとえば、 boolean から String に変換します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public StandardTypeConverter()
public StandardTypeConverter(ConversionService conversionService)
conversionService
- 委譲する ConversionServicepublic StandardTypeConverter(SupplierSE<ConversionService> conversionService)
conversionService
- 委譲する ConversionService のサプライヤー public boolean canConvert(@Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
TypeConverter
true
を返します。TypeConverter
の canConvert
sourceType
- ソース型を説明する型記述子 targetType
- リクエストされた結果型を説明する型記述子 true
(その変換を実行できる場合)@Nullable public ObjectSE convertValue(@Nullable ObjectSE value, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
TypeConverter
boolean
から String
に変換します。TypeDescriptor
パラメーターは、型付きコレクションのサポートを有効にします。呼び出し側は、単なる List
ではなく、たとえば List<Integer>
を優先する場合があります。
TypeConverter
の convertValue
value
- 変換される値 sourceType
- ソースオブジェクトに関する追加情報を提供する型記述子 targetType
- リクエストされた結果型に関する追加情報を提供する型記述子