Interface InvokeInstruction
- All Superinterfaces:
ClassFileElementPREVIEW,CodeElementPREVIEW,InstructionPREVIEW
InvokeInstruction is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
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.INVOKEPREVIEW. Delivered as a
CodeElementPREVIEW when traversing the elements of a CodeModelPREVIEW.- Since:
- 22
-
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 theMethodRefEntryPREVIEW orInterfaceMethodRefEntryPREVIEW constant described by this instruction.name()Returns the name of the method.static InvokeInstructionPREVIEWof(OpcodePREVIEW op, ClassEntryPREVIEW owner, NameAndTypeEntryPREVIEW nameAndType, boolean isInterface) Returns an invocation instruction.static InvokeInstructionPREVIEWof(OpcodePREVIEW op, ClassEntryPREVIEW owner, Utf8EntryPREVIEW name, Utf8EntryPREVIEW type, boolean isInterface) Returns an invocation instruction.static InvokeInstructionPREVIEWof(OpcodePREVIEW op, MemberRefEntryPREVIEW method) Returns an invocation instruction.default ClassEntryPREVIEWowner()Returns the class holding the method.type()Returns the method descriptor of the method.default MethodTypeDescReturns a symbolic descriptor for the method type.Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
method
MemberRefEntryPREVIEW method()Returns theMethodRefEntryPREVIEW orInterfaceMethodRefEntryPREVIEW constant described by this instruction.- Returns:
- the
MethodRefEntryPREVIEW orInterfaceMethodRefEntryPREVIEW constant 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
-
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.INVOKEPREVIEWmethod- a constant pool entry describing the method- Returns:
- an invocation instruction
- Throws:
IllegalArgumentException- if the opcode kind is notOpcode.Kind.INVOKEPREVIEW.
-
of
static InvokeInstructionPREVIEW of(OpcodePREVIEW op, ClassEntryPREVIEW owner, Utf8EntryPREVIEW name, Utf8EntryPREVIEW type, boolean isInterface) Returns an invocation instruction.- Parameters:
op- the opcode for the specific type of invocation instruction, which must be of kindOpcode.Kind.INVOKEPREVIEWowner- 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 InvokeInstructionPREVIEW of(OpcodePREVIEW op, ClassEntryPREVIEW owner, NameAndTypeEntryPREVIEW nameAndType, boolean isInterface) Returns an invocation instruction.- Parameters:
op- the opcode for the specific type of invocation instruction, which must be of kindOpcode.Kind.INVOKEPREVIEWowner- 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
-
InvokeInstructionwhen preview features are enabled.