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 inherited from interface AttributedElement
attributes, findAttribute, findAttributes
Methods inherited from interface CompoundElement
elementList, elementStream, forEach, iterator, toDebugString
Methods inherited from interface 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
-