Interface CodeModel

All Superinterfaces:
AttributedElementPREVIEW, ClassFileElementPREVIEW, CompoundElementPREVIEW<CodeElementPREVIEW>, Iterable<CodeElementPREVIEW>, MethodElementPREVIEW
All Known Subinterfaces:
CodeAttributePREVIEW

public sealed interface CodeModel extends CompoundElementPREVIEW<CodeElementPREVIEW>, AttributedElementPREVIEW, MethodElementPREVIEW permits CodeAttributePREVIEW (not exhaustive)
CodeModel is a preview API of the Java platform.
Programs can only use CodeModel when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the body of a method (the Code attribute). The instructions of the method body are accessed via a streaming view (e.g., CompoundElement.elements()PREVIEW).
Since:
22
  • Method Details

    • maxLocals

      int maxLocals()
      Returns the maximum size of the local variable table.
      Returns:
      the maximum size of the local variable table
    • maxStack

      int maxStack()
      Returns the maximum size of the operand stack.
      Returns:
      the maximum size of the operand stack
    • parent

      Returns the enclosing method, if known.
      Returns:
      the enclosing method, if known
    • exceptionHandlers

      List<ExceptionCatchPREVIEW> exceptionHandlers()
      Returns the exception table of the method. The exception table is also modeled by ExceptionCatchPREVIEW elements in the streaming view.
      Returns:
      the exception table of the method