Interface InvokeInstruction
- All Superinterfaces:
ClassFileElement,CodeElement,Instruction
Models a method invocation instruction in the
code array of a
Code attribute, other than invokedynamic. Corresponding opcodes
will have a kind of Opcode.Kind.INVOKE. Delivered as a
CodeElement when traversing the elements of a CodeModel.- Since:
- 24
-
Method Summary
Modifier and TypeMethodDescriptionintcount()Returns thecountvalue of aninvokeinterfaceinstruction, as defined in JVMS 6.5 or0forinvokespecial,invokestaticandinvokevirtualinstructions.booleanReturns whether the class holding the method is an interface.method()Returns theMethodRefEntryorInterfaceMethodRefEntryconstant described by this instruction.default Utf8Entryname()Returns the name of the method.static InvokeInstructionof(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType, boolean isInterface) Returns an invocation instruction.static InvokeInstructionof(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type, boolean isInterface) Returns an invocation instruction.static InvokeInstructionof(Opcode op, MemberRefEntry method) Returns an invocation instruction.default ClassEntryowner()Returns the class holding the method.default Utf8Entrytype()Returns the method descriptor of the method.default MethodTypeDescReturns a symbolic descriptor for the method type.Methods declared in interface java.lang.classfile.Instruction
opcode, sizeInBytes
-
Method Details
-
method
MemberRefEntry method()Returns theMethodRefEntryorInterfaceMethodRefEntryconstant described by this instruction.- Returns:
- the
MethodRefEntryorInterfaceMethodRefEntryconstant described by this instruction
-
isInterface
boolean isInterface()Returns whether the class holding the method is an interface.- Returns:
- whether the class holding the method is an interface
-
count
int count()Returns thecountvalue of aninvokeinterfaceinstruction, as defined in JVMS 6.5 or0forinvokespecial,invokestaticandinvokevirtualinstructions.- Returns:
- the
countvalue of aninvokeinterfaceinstruction, as defined in JVMS 6.5 or0forinvokespecial,invokestaticandinvokevirtualinstructions
-
owner
Returns the class holding the method.- Returns:
- the class holding the method
-
name
-
type
Returns the method descriptor of the method.- Returns:
- the method descriptor of the method
-
typeSymbol
Returns a symbolic descriptor for the method type.- Returns:
- a symbolic descriptor for the method type
-
of
Returns an invocation instruction.- Parameters:
op- the opcode for the specific type of invocation instruction, which must be of kindOpcode.Kind.INVOKEmethod- a constant pool entry describing the method- Returns:
- an invocation instruction
- Throws:
IllegalArgumentException- if the opcode kind is notOpcode.Kind.INVOKE.
-
of
static InvokeInstruction of(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type, boolean isInterface) Returns an invocation instruction.- Parameters:
op- the opcode for the specific type of invocation instruction, which must be of kindOpcode.Kind.INVOKEowner- the class holding the methodname- the name of the methodtype- the method descriptorisInterface- whether the class holding the method is an interface- Returns:
- an invocation instruction
-
of
static InvokeInstruction of(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType, boolean isInterface) Returns an invocation instruction.- Parameters:
op- the opcode for the specific type of invocation instruction, which must be of kindOpcode.Kind.INVOKEowner- the class holding the methodnameAndType- the name and type of the methodisInterface- whether the class holding the method is an interface- Returns:
- an invocation instruction
-