public final class MethodIntrospector extends ObjectSE
通常、アノテーション付きハンドラーメソッドを見つけるために使用されますが、必ずしもそうとは限りません。
修飾子と型 | クラスと説明 |
---|---|
static interface | MethodIntrospector.MetadataLookup<T> 特定のメソッドのメタデータ検索用のコールバックインターフェース。 |
修飾子と型 | メソッドと説明 |
---|---|
static MethodSE | selectInvocableMethod(MethodSE method, ClassSE<?> targetType) ターゲット型で呼び出し可能なメソッドを選択します。ターゲット型で実際に公開されている場合は特定のメソッド自体、またはターゲット型のインターフェースの 1 つまたはターゲット型自体で対応するメソッドを選択します。 |
static <T> MapSE<MethodSE,T> | selectMethods(ClassSE<?> targetType, MethodIntrospector.MetadataLookup<T> metadataLookup) 関連するメタデータの検索に基づいて、指定されたターゲット型のメソッドを選択します。 |
static SetSE<MethodSE> | selectMethods(ClassSE<?> targetType, ReflectionUtils.MethodFilter methodFilter) フィルターに基づいて、指定されたターゲット型のメソッドを選択します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static <T> MapSE<MethodSE,T> selectMethods(ClassSE<?> targetType, MethodIntrospector.MetadataLookup<T> metadataLookup)
呼び出し元は、MethodIntrospector.MetadataLookup
パラメーターを使用して対象のメソッドを定義し、関連するメタデータを結果マップに収集できます。
targetType
- メソッドを検索するターゲット型 metadataLookup
- 目的のメソッドをインスペクションする MethodIntrospector.MetadataLookup
コールバック。一致がある場合は指定されたメソッドに関連付けられる null 以外のメタデータを返し、一致しない場合は null
public static SetSE<MethodSE> selectMethods(ClassSE<?> targetType, ReflectionUtils.MethodFilter methodFilter)
呼び出し元は、MethodFilter
パラメーターを使用して対象のメソッドを定義します。
targetType
- メソッドを検索するターゲット型 methodFilter
- 対象のハンドラーメソッドの認識を支援する MethodFilter
public static MethodSE selectInvocableMethod(MethodSE method, ClassSE<?> targetType)
ユーザーが宣言したインターフェースは、ターゲットクラスのメソッドに対応する関連メタデータを含む可能性が高いため、一致するものが推奨されます。
method
- チェックする方法 targetType
- メソッドを検索するターゲット型 (通常、インターフェースベースの JDK プロキシ)IllegalStateExceptionSE
- 指定されたメソッドが指定されたターゲット型で起動できない場合 (通常はプロキシの不一致が原因です)