Interface CodeModel
- All Superinterfaces:
AttributedElement
,ClassFileElement
,CompoundElement<CodeElement>
,Iterable<CodeElement>
,MethodElement
- All Known Subinterfaces:
CodeAttribute
public sealed interface CodeModel
extends CompoundElement<CodeElement>, AttributedElement, MethodElement
permits CodeAttribute (not exhaustive)
Models the body of a method (the
Code
attribute). The instructions
of the method body are accessed via a streaming view.- Since:
- 24
-
Method Summary
Modifier and TypeMethodDescriptionReturns the exception table of the method.parent()
Returns the enclosing method, if known.Methods declared in interface java.lang.classfile.AttributedElement
attributes, findAttribute, findAttributes
Methods declared in interface java.lang.classfile.CompoundElement
elementList, elementStream, forEach, iterator, toDebugString
Methods declared in interface java.lang.Iterable
spliterator
-
Method Details
-
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 byExceptionCatch
elements in the streaming view.- Returns:
- the exception table of the method
-