パッケージ org.springframework.beans

クラス PropertyMatches

java.lang.ObjectSE
org.springframework.beans.PropertyMatches

public abstract class PropertyMatches extends ObjectSE
設定可能な距離に応じて、プロパティの一致を計算するためのヘルパークラス。潜在的な一致のリストと、エラーメッセージを生成する簡単な方法を提供します。java Bean プロパティとフィールドの両方で機能します。

主にフレームワーク内、特にバインディング機能内で使用するため。

導入:
2.0
作成者:
Alef Arendsen, Arjen Poutsma, Juergen Hoeller, Stephane Nicoll
関連事項:
  • フィールドの詳細

    • DEFAULT_MAX_DISTANCE

      public static final int DEFAULT_MAX_DISTANCE
      デフォルトの最大プロパティ距離: 2.
      関連事項:
  • メソッドの詳細

    • forProperty

      public static PropertyMatches forProperty(StringSE propertyName, ClassSE<?> beanClass)
      指定された Bean プロパティの PropertyMatches を作成します。
      パラメーター:
      propertyName - 可能な一致を見つけるためのプロパティの名前
      beanClass - 一致を検索する Bean クラス
    • forProperty

      public static PropertyMatches forProperty(StringSE propertyName, ClassSE<?> beanClass, int maxDistance)
      指定された Bean プロパティの PropertyMatches を作成します。
      パラメーター:
      propertyName - 可能な一致を見つけるためのプロパティの名前
      beanClass - 一致を検索する Bean クラス
      maxDistance - マッチに許可される最大プロパティ距離
    • forField

      public static PropertyMatches forField(StringSE propertyName, ClassSE<?> beanClass)
      指定されたフィールドプロパティの PropertyMatches を作成します。
      パラメーター:
      propertyName - 一致する可能性のあるフィールドを見つけるフィールドの名前
      beanClass - 一致を検索する Bean クラス
    • forField

      public static PropertyMatches forField(StringSE propertyName, ClassSE<?> beanClass, int maxDistance)
      指定されたフィールドプロパティの PropertyMatches を作成します。
      パラメーター:
      propertyName - 一致する可能性のあるフィールドを見つけるフィールドの名前
      beanClass - 一致を検索する Bean クラス
      maxDistance - マッチに許可される最大プロパティ距離
    • getPropertyName

      public StringSE getPropertyName()
      リクエストされたプロパティの名前を返します。
    • getPossibleMatches

      public StringSE[] getPossibleMatches()
      計算された可能な一致を返します。
    • buildErrorMessage

      public abstract StringSE buildErrorMessage()
      指定された無効なプロパティ名のエラーメッセージを作成し、プロパティの一致を示します。
    • appendHintMessage

      protected void appendHintMessage(StringBuilderSE msg)