Interface MonitorInstruction
- All Superinterfaces:
ClassFileElementPREVIEW
,CodeElementPREVIEW
,InstructionPREVIEW
MonitorInstruction
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
monitorenter
or monitorexit
instruction in the
code
array of a Code
attribute. Delivered as a CodeElement
PREVIEW when traversing the elements of a CodeModel
PREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionstatic MonitorInstructionPREVIEW
Returns a monitor instruction.Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
of
Returns a monitor instruction.- Parameters:
op
- the opcode for the specific type of monitor instruction, which must be of kindOpcode.Kind.MONITOR
PREVIEW- Returns:
- a monitor instruction
- Throws:
IllegalArgumentException
- if the opcode kind is notOpcode.Kind.MONITOR
PREVIEW.
-
MonitorInstruction
when preview features are enabled.