Interface ReturnInstruction
- All Superinterfaces:
ClassFileElementPREVIEW,CodeElementPREVIEW,InstructionPREVIEW
ReturnInstruction 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 return-from-method instruction in the
code array of a
Code attribute. Corresponding opcodes will have a kind of
Opcode.Kind.RETURNPREVIEW. Delivered as a CodeElementPREVIEW when
traversing the elements of a CodeModelPREVIEW.- Since:
- 22
-
Method Summary
Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
typeKind
-
of
Returns a return instruction.- Parameters:
typeKind- the type of the return instruction- Returns:
- a return instruction
-
of
Returns a return instruction.- Parameters:
op- the opcode for the specific type of return instruction, which must be of kindOpcode.Kind.RETURNPREVIEW- Returns:
- a return instruction
- Throws:
IllegalArgumentException- if the opcode kind is notOpcode.Kind.RETURNPREVIEW.
-
ReturnInstructionwhen preview features are enabled.