クラス ReflectiveMethodExecutor

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

public class ReflectiveMethodExecutor extends ObjectSE implements MethodExecutor
リフレクションを介して機能する MethodExecutor
導入:
3.0
作成者:
Andy Clement, Juergen Hoeller
  • コンストラクターの詳細

    • ReflectiveMethodExecutor

      public ReflectiveMethodExecutor(MethodSE method)
      指定されたメソッドの新しいエグゼキューターを作成します。
      パラメーター:
      method - 呼び出すメソッド
    • ReflectiveMethodExecutor

      public ReflectiveMethodExecutor(MethodSE method, @Nullable ClassSE<?> targetClass)
      指定されたメソッドの新しいエグゼキューターを作成します。
      パラメーター:
      method - 呼び出すメソッド
      targetClass - メソッドを呼び出すターゲットクラス
      導入:
      5.3.16
  • メソッドの詳細

    • getMethod

      public final MethodSE getMethod()
      このエグゼキューターが構成された元のメソッドを返します。
    • getPublicDeclaringClass

      @Nullable public ClassSE<?> getPublicDeclaringClass()
      このメソッドを宣言するメソッドの宣言クラス階層内で最初のパブリッククラスを見つけます。

      リフレクティブメソッド検出ロジックは、リフレクション経由で簡単に呼び出すことができる適切なメソッドを見つけますが、式のコンパイル時に可視性の制限により生成されたコードから呼び出すことができない場合があります。例: 非パブリッククラスが toString() をオーバーライドする場合、このヘルパーメソッドは型階層をたどって、メソッドを宣言する最初のパブリック型 (存在する場合) を見つけます。toString() の場合、オブジェクトまでトラバースする可能性があります。

    • didArgumentConversionOccur

      public boolean didArgumentConversionOccur()
    • execute

      public TypedValue execute(EvaluationContext context, ObjectSE target, ObjectSE... arguments) throws AccessException
      インターフェースからコピーされた説明: MethodExecutor
      指定された引数を使用して、指定されたコンテキストでメソッドを実行します。
      次で指定:
      インターフェース MethodExecutorexecute 
      パラメーター:
      context - メソッドが実行されている評価コンテキスト
      target - メソッド呼び出しのターゲット。static メソッドの場合は null になる可能性があります
      arguments - メソッドの引数。メソッドの実行に必要なものに (数と型の点で) 一致する必要があります
      戻り値:
      メソッドから返された値
      例外:
      AccessException - メソッドの実行に問題がある場合、またはこの MethodExecutor が古くなった場合