- All Superinterfaces:
AttributedElement,ClassFileElement,CompoundElement<CodeElement>,Iterable<CodeElement>,MethodElement
- All Known Subinterfaces:
CodeAttribute
- All Known Implementing Classes:
BoundAttribute.BoundCodeAttribute,BufferedCodeBuilder.Model,CodeImpl
public sealed interface CodeModel
extends CompoundElement<CodeElement>, AttributedElement, MethodElement
permits CodeAttribute, BufferedCodeBuilder.Model, CodeImpl
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()).- Since:
- 22
-
Method Summary
Methods inherited from interface org.glavo.classfile.AttributedElement
attributes, findAttribute, findAttributesMethods inherited from interface org.glavo.classfile.CompoundElement
elementList, elements, elementStream, forEachElement, iteratorMethods inherited from 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<MethodModel> parent()Returns the enclosing method, if known.- Returns:
- the enclosing method, if known
-
exceptionHandlers
List<ExceptionCatch> exceptionHandlers()Returns the exception table of the method. The exception table is also modeled byExceptionCatchelements in the streaming view.- Returns:
- the exception table of the method
-