クラス MethodInvokerUtils
java.lang.ObjectSE
org.springframework.batch.support.MethodInvokerUtils
MethodInvoker インスタンスを作成するためのユーティリティメソッド。
- 導入:
- 2.0
- 作成者:
- Lucas Ward, Mahmoud Ben Hassine, Taeik Lim
方法の概要
修飾子と型メソッド説明static MethodInvokergetMethodInvokerByAnnotation(ClassSE<? extends AnnotationSE> annotationType, ObjectSE target) 提供されたオブジェクトに提供されたアノテーションを使用して、メソッドのMethodInvokerを作成します。static MethodInvokergetMethodInvokerByAnnotation(ClassSE<? extends AnnotationSE> annotationType, ObjectSE target, ClassSE<?>... expectedParamTypes) annotationType に基づいてデリゲートから MethodInvoker を作成します。static MethodInvokergetMethodInvokerByName(ObjectSE object, StringSE methodName, boolean paramsRequired, ClassSE<?>... paramTypes) 提供されたメソッド名を使用してMethodInvokerを作成して検索します。static MethodInvokergetMethodInvokerForInterface(ClassSE<?> cls, StringSE methodName, ObjectSE object, ClassSE<?>... paramTypes) 提供されたインターフェースとそのインターフェースからのメソッド名を使用してMethodInvokerを作成します。static MethodInvoker単一の public メソッドからデリゲートのMethodInvokerを作成します。static StringSEgetParamTypesString(ClassSE<?>... paramTypes) パラメーター型の配列の文字列表現を作成します。
方法の詳細
getMethodInvokerByName
public static MethodInvoker getMethodInvokerByName(ObjectSE object, StringSE methodName, boolean paramsRequired, ClassSE<?>... paramTypes) 提供されたメソッド名を使用してMethodInvokerを作成して検索します。- パラメーター:
object- 呼び出されるmethodName- 呼び出されるメソッドparamsRequired- パラメーターが必要かどうかを示すブール値。false の場合、メソッドの引数なしバージョンが検索されます。paramTypes- - 検索するメソッドのパラメーター型。- 戻り値:
- MethodInvoker (メソッドが見つかった場合)
getParamTypesString
パラメーター型の配列の文字列表現を作成します。- パラメーター:
paramTypes- 使用するパラメーターの種類- 戻り値:
- 文字列これらの型の文字列表現
getMethodInvokerForInterface
@Nullable public static MethodInvoker getMethodInvokerForInterface(ClassSE<?> cls, StringSE methodName, ObjectSE object, ClassSE<?>... paramTypes) 提供されたインターフェースとそのインターフェースからのメソッド名を使用してMethodInvokerを作成します。- パラメーター:
cls- 名前の付いたメソッドを検索するためのインターフェースmethodName- 呼び出されるメソッドobject- 呼び出されるparamTypes- - 検索するメソッドのパラメーター型。- 戻り値:
- メソッドが見つかった場合は MethodInvoker、見つからなかった場合は null。
getMethodInvokerByAnnotation
public static MethodInvoker getMethodInvokerByAnnotation(ClassSE<? extends AnnotationSE> annotationType, ObjectSE target, ClassSE<?>... expectedParamTypes) annotationType に基づいてデリゲートから MethodInvoker を作成します。アノテーションが付けられたメソッドに有効なパラメーターセットがあることを確認します。- パラメーター:
annotationType- スキャンするアノテーションtarget- ターゲットオブジェクトexpectedParamTypes- メソッドに期待されるパラメーター型- 戻り値:
- MethodInvoker
getMethodInvokerByAnnotation
@Nullable public static MethodInvoker getMethodInvokerByAnnotation(ClassSE<? extends AnnotationSE> annotationType, ObjectSE target) 提供されたオブジェクトに提供されたアノテーションを使用して、メソッドのMethodInvokerを作成します。メソッドに適用できないアノテーション(つまり、METHOD の要素型でアノテーションが付けられていないアノテーション)は、例外がスローされる原因になります。- パラメーター:
annotationType- 検索されるtarget- 呼び出される- 戻り値:
- 提供されたアノテーションの MethodInvoker。何も見つからない場合は null。
getMethodInvokerForSingleArgument
単一の public メソッドからデリゲートのMethodInvokerを作成します。- パラメーター:
target- 適切なメソッドを検索するためのオブジェクト。- 戻り値:
- デリゲートのメソッドを呼び出す
MethodInvoker。