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.
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 Summary
Methods declared in interface java.lang.classfile.AttributedElementPREVIEW
attributes, findAttribute, findAttributesMethods declared in interface java.lang.classfile.CompoundElementPREVIEW
elementList, elements, elementStream, forEachElement, iteratorMethods declared in interface java.lang.Iterable
forEach, spliterator
-
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
Optional<MethodModelPREVIEW> 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 byExceptionCatchPREVIEW elements in the streaming view.- Returns:
- the exception table of the method
-
CodeModelwhen preview features are enabled.