Code attribute). A Code
attribute is viewed as a composition of CodeElements, which is the only way to access Instructions; the
order of elements of a code model is significant.
A CodeModel is obtained from MethodModel#code(), or in the
traversal of the member elements of a method.
MethodBuilder#withCode is the main way to build code models. MethodBuilder#transformCode and CodeBuilder#transforming allow
creating new Code attributes by selectively processing the original
code elements and directing the results to a code builder.
A Code attribute holds attributes, but they are usually not member
elements, but are decomposed to PseudoInstruction, accessible
according to DeadLabelsOption, DebugElementsOption, and
LineNumbersOption. StackMapTableAttribute can only be
accessed via explicit attribute reading, as it
is considered a derived property from the code body.
Code Attribute
MethodModel#code(), CodeTransform, CodeAttribute
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: the exception table of the methodReturns the exception table of the method. |
| public Optional |
| exceptionHandlers | back to summary |
|---|---|
| public List Returns the exception table of the method. The exception table is also
modeled by
| |
| parent | back to summary |
|---|---|
| public Optional Returns the enclosing method, if known.
| |