ClassBuilder#withMethod(String, MethodTypeDesc, int, Consumer). ClassBuilder#withMethodBody(String, MethodTypeDesc, int, Consumer) is
useful if no attribute on the method except Code needs to
be configured, skipping the method handler.
Refer to ClassFileBuilder for general guidance and caution around
the use of builders for structures in the class file format.
MethodModel, MethodTransform
| Modifier and Type | Method and Description |
|---|---|
| public MethodBuilder | Returns: this builderthe method body to be transformed code, CodeTransform the transform to apply to the method body transform)Build the method body for this method by transforming the body of another method. |
| public MethodBuilder | Returns: this buildera handler receiving a code)CodeBuilderBuild the method body for this method. |
| public default MethodBuilder | Returns: this builderthe access flags, as a bit mask flags)Sets the method access flags. |
| public default MethodBuilder | Returns: this builderthe access flags, as a bit mask flags)Sets the method access flags. |
| transformCode | back to summary |
|---|---|
| public MethodBuilder transformCode(CodeModel code, CodeTransform transform) Build the method body for this method by transforming the body of another method. This method behaves as if: withCode(cob -> cob.transform(code, transform));
| |
| withCode | back to summary |
|---|---|
| public MethodBuilder withCode(Consumer<? super CodeBuilder> code) Build the method body for this method.
| |
| withFlags | back to summary |
|---|---|
| public default MethodBuilder withFlags(int flags) Sets the method access flags. The
| |
| withFlags | back to summary |
|---|---|
| public default MethodBuilder withFlags(AccessFlag... flags) Sets the method access flags. The
| |