インタフェースLocalVariable

すべてのスーパー・インタフェース:
ClassFileElement, CodeElement, PseudoInstruction

public sealed interface LocalVariable extends PseudoInstruction
LocalVariableTable属性内の単一のエントリをモデル化する擬似命令。 ClassFile.DebugElementsOptionオプションの設定に従って、CodeModelの要素のトラバース中にCodeElementとして提供されます。

ローカル変数エントリはcompositeです:

LocalVariable(
    int slot,
    String name,
    ClassDesc type,
    Label startScope,
    Label endScope
)
ここで、slot[0, 65535]内にあります。

別のモデルLocalVariableInfoは、ローカル変数エントリもモデル化します。これは、CodeModelへの依存がなく、Labelsではなくintsとしてbci値を表し、LocalVariableTableAttributeのコンポーネントとして使用されます。

APIのノート:
LocalVariableは、Javaソース・コードのすべてのローカル変数に使用されます。 ローカル変数にパラメータ化された型、型引数または前の型のいずれかの配列型がある場合は、そのローカル変数にもLocalVariableTypeを作成する必要があります。
導入されたバージョン:
24
関連項目:
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    ローカル変数スコープの終了範囲を返します。
    ローカル変数名を返します。
    of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope)
    ローカル変数擬似命令を返します。
    of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope)
    ローカル変数擬似命令を返します。
    int
    ローカル変数スロットを返します。
    ローカル変数スコープの開始範囲を返します。
    ローカル変数のフィールド記述子文字列を返します。
    default ClassDesc
    ローカル変数型をシンボリック記述子として返します。
  • メソッドの詳細

    • slot

      int slot()
      ローカル変数スロットを返します。 値は[0, 65535]内にあります。
      戻り値:
      ローカル変数スロット
    • name

      Utf8Entry name()
      ローカル変数名を返します。
      戻り値:
      ローカル変数名
    • type

      Utf8Entry type()
      ローカル変数のフィールド記述子文字列を返します。
      APIのノート:
      ローカル変数のタイプのシンボリック記述子は、typeSymbol()から入手できます。
      戻り値:
      ローカル変数のフィールド記述子文字列
    • typeSymbol

      default ClassDesc typeSymbol()
      ローカル変数型をシンボリック記述子として返します。
      戻り値:
      シンボリック記述子としてのローカル変数型
    • startScope

      Label startScope()
      ローカル変数スコープの開始範囲を返します。
      戻り値:
      ローカル変数スコープの開始範囲
    • endScope

      Label endScope()
      ローカル変数スコープの終了範囲を返します。
      戻り値:
      ローカル変数スコープの終了範囲
    • of

      static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope)
      ローカルの変数擬似命令を返します。slot[0, 65535]内に存在する必要があります。
      パラメータ:
      slot - ローカル変数スロット
      nameEntry - ローカル変数名
      descriptorEntry - ローカル変数記述子
      startScope - ローカル変数スコープの開始範囲
      endScope - ローカル変数スコープの終了範囲
      戻り値:
      ローカル変数擬似命令
      スロー:
      IllegalArgumentException - slotが範囲外の場合
    • of

      static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope)
      ローカルの変数擬似命令を返します。slot[0, 65535]内に存在する必要があります。
      パラメータ:
      slot - ローカル変数スロット
      name - ローカル変数名
      descriptor - ローカル変数記述子
      startScope - ローカル変数スコープの開始範囲
      endScope - ローカル変数スコープの終了範囲
      戻り値:
      ローカル変数擬似命令
      スロー:
      IllegalArgumentException - slotが範囲外の場合