インタフェースInvokeInstruction
- すべてのスーパー・インタフェース:
ClassFileElement,CodeElement,Instruction
public sealed interface InvokeInstruction extends Instruction
invokedynamic以外の Code属性のcode配列のメソッド呼出し命令をモデル化します。 対応するopcodesのkindはOpcode.Kind.INVOKEです。 CodeModelの要素をトラバースするときに、CodeElementとして提供されます。
メソッド呼出し命令はコンポジットです:
InvokeInstruction(
Opcode opcode,
MethodRefEntry | InterfaceMethodRefEntry method)
)
methodはinvokeinterface opcodeのInterfaceMethodRefEntryである必要があり、invokevirtual opcodeの MethodRefEntryである必要があります。invokestaticおよびinvokespecialには、methodのどちらのタイプのエントリでもかまいません。- 導入されたバージョン:
- 24
- 関連項目:
-
メソッドのサマリー
修飾子と型メソッド説明intcount()invokeinterface命令のcount値を返します。その他の命令の場合は0を返します。booleanメソッドを保持するクラスまたはインタフェースのどちらがインタフェースであるかを返します。method()この命令で記述されたMethodRefEntryまたはInterfaceMethodRefEntry定数を返します。default Utf8Entryname()メソッドの名前を返します。static InvokeInstructionof(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType, boolean isInterface) invocation instructionを返します。static InvokeInstructionof(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type, boolean isInterface) invocation instructionを返します。static InvokeInstructionof(Opcode op, MemberRefEntry method) invocation instructionを返します。default ClassEntryowner()メソッドを保持するクラスまたはインタフェースを返します。default Utf8Entrytype()メソッドのメソッド記述子文字列を返します。default MethodTypeDescメソッド・タイプのシンボリック記述子を返します。インタフェースjava.lang.classfile.Instructionで宣言されたメソッド
opcode, sizeInBytes
-
メソッドの詳細
-
method
MemberRefEntry method()この命令で記述されたMethodRefEntryまたはInterfaceMethodRefEntry定数を返します。- 戻り値:
- この命令で記述された
MethodRefEntryまたはInterfaceMethodRefEntry定数
-
isInterface
boolean isInterface()メソッドを保持するクラスまたはインタフェースのどちらがインタフェースであるかを返します。- 戻り値:
- メソッドを保持するクラスまたはインタフェースがインタフェースかどうか
-
count
int count()invokeinterface命令のcount値を返します。その他の命令の場合は0を返します。invokeinterface命令の場合、この値は、すべての引数の「スロット・サイズ」の合計に1を加えた値と同じである必要があります。これは、このインタフェース・メソッド呼出し命令によって消費されるオペランド・スタックの深さの数と同じです。- 戻り値:
invokeinterface命令のcount値、または他の命令の0- Java Virtual Machine仕様を参照してください:
-
6.5.invokeinterface invokeinterface
-
owner
-
name
-
type
default Utf8Entry type()メソッドのメソッド記述子文字列を返します。- APIのノート:
- メソッドのタイプのシンボリック記述子は、
typeSymbol()から入手できます。 - 戻り値:
- メソッドのメソッド記述子文字列
-
typeSymbol
-
of
static InvokeInstruction of(Opcode op, MemberRefEntry method) invocation instructionを返します。- パラメータ:
op- 特定のタイプの呼出し命令のopcode。Opcode.Kind.INVOKEの種類である必要がありますmethod- メソッドを記述する定数プール・エントリ- 戻り値:
- invocation instruction
- スロー:
IllegalArgumentException- opcodeの種類がOpcode.Kind.INVOKEでない場合
-
of
static InvokeInstruction of(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type, boolean isInterface) invocation instructionを返します。- パラメータ:
op- 特定のタイプの呼出し命令のopcode。Opcode.Kind.INVOKEの種類である必要がありますowner- メソッドを保持するクラスname- メソッドの名前type- メソッド記述子isInterface- メソッドを保持するクラスがインタフェースかどうか- 戻り値:
- invocation instruction
- スロー:
IllegalArgumentException- opcodeの種類がOpcode.Kind.INVOKEでない場合
-
of
static InvokeInstruction of(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType, boolean isInterface) invocation instructionを返します。- パラメータ:
op- 特定のタイプの呼出し命令のopcode。Opcode.Kind.INVOKEの種類である必要がありますowner- メソッドを保持するクラスnameAndType- メソッドの名前とタイプisInterface- メソッドを保持するクラスがインタフェースかどうか- 戻り値:
- invocation instruction
- スロー:
IllegalArgumentException- opcodeの種類がOpcode.Kind.INVOKEでない場合
-