クラス StandardTypeConverter

java.lang.ObjectSE
org.springframework.expression.spel.support.StandardTypeConverter
実装されたすべてのインターフェース:
TypeConverter

public class StandardTypeConverter extends ObjectSE implements TypeConverter
コア Spring ConversionService に委譲する、TypeConverter インターフェースのデフォルト実装。
導入:
3.0
作成者:
Juergen Hoeller, Andy Clement
関連事項:
  • コンストラクターの詳細

    • StandardTypeConverter

      public StandardTypeConverter()
      デフォルトの ConversionService 用に StandardTypeConverter を作成します。
      関連事項:
    • StandardTypeConverter

      public StandardTypeConverter(ConversionService conversionService)
      指定された ConversionService の StandardTypeConverter を作成します。
      パラメーター:
      conversionService - 委譲する ConversionService
    • StandardTypeConverter

      public StandardTypeConverter(SupplierSE<ConversionService> conversionService)
      指定された ConversionService の StandardTypeConverter を作成します。
      パラメーター:
      conversionService - 委譲する ConversionService のサプライヤー
      導入:
      5.3.11
  • メソッドの詳細

    • canConvert

      public boolean canConvert(@Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
      インターフェースからコピーされた説明: TypeConverter
      型コンバーターが指定された型を目的のターゲット型に変換できる場合は、true を返します。
      次で指定:
      インターフェース TypeConvertercanConvert 
      パラメーター:
      sourceType - ソース型を説明する型記述子
      targetType - リクエストされた結果型を説明する型記述子
      戻り値:
      true (その変換を実行できる場合)
    • convertValue

      @Nullable public ObjectSE convertValue(@Nullable ObjectSE value, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType)
      インターフェースからコピーされた説明: TypeConverter
      値をある型から別の型に変換(強制)します。たとえば、boolean から String に変換します。

      TypeDescriptor パラメーターは、型付きコレクションのサポートを有効にします。呼び出し側は、単なる List ではなく、たとえば List<Integer> を優先する場合があります。

      次で指定:
      インターフェース TypeConverterconvertValue 
      パラメーター:
      value - 変換される値
      sourceType - ソースオブジェクトに関する追加情報を提供する型記述子
      targetType - リクエストされた結果型に関する追加情報を提供する型記述子
      戻り値:
      変換された値